Commit 4f5e8386 authored by Kees Cook's avatar Kees Cook

usercopy: Remove pointer from overflow report

Using %p was already mostly useless in the usercopy overflow reports,
so this removes it entirely to avoid confusion now that %p-hashing
is enabled.

Fixes: ad67b74d ("printk: hash addresses printed with %p")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent ae64f9bd
...@@ -58,12 +58,11 @@ static noinline int check_stack_object(const void *obj, unsigned long len) ...@@ -58,12 +58,11 @@ static noinline int check_stack_object(const void *obj, unsigned long len)
return GOOD_STACK; return GOOD_STACK;
} }
static void report_usercopy(const void *ptr, unsigned long len, static void report_usercopy(unsigned long len, bool to_user, const char *type)
bool to_user, const char *type)
{ {
pr_emerg("kernel memory %s attempt detected %s %p (%s) (%lu bytes)\n", pr_emerg("kernel memory %s attempt detected %s '%s' (%lu bytes)\n",
to_user ? "exposure" : "overwrite", to_user ? "exposure" : "overwrite",
to_user ? "from" : "to", ptr, type ? : "unknown", len); to_user ? "from" : "to", type ? : "unknown", len);
/* /*
* For greater effect, it would be nice to do do_group_exit(), * For greater effect, it would be nice to do do_group_exit(),
* but BUG() actually hooks all the lock-breaking and per-arch * but BUG() actually hooks all the lock-breaking and per-arch
...@@ -261,6 +260,6 @@ void __check_object_size(const void *ptr, unsigned long n, bool to_user) ...@@ -261,6 +260,6 @@ void __check_object_size(const void *ptr, unsigned long n, bool to_user)
return; return;
report: report:
report_usercopy(ptr, n, to_user, err); report_usercopy(n, to_user, err);
} }
EXPORT_SYMBOL(__check_object_size); EXPORT_SYMBOL(__check_object_size);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment