diff options
author | Kees Cook <keescook@chromium.org> | 2018-01-02 15:15:53 -0500 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-01-15 15:07:44 -0500 |
commit | 4f5e838605c264fcf16c3ff9495bd83da99acc6a (patch) | |
tree | b4862e3ea2d12a0c6529a0734ea222909a73a785 | |
parent | ae64f9bd1d3621b5e60d7363bc20afb46aede215 (diff) |
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: ad67b74d2469d9b8 ("printk: hash addresses printed with %p")
Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r-- | mm/usercopy.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c index a9852b24715d..5df1e68d4585 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c | |||
@@ -58,12 +58,11 @@ static noinline int check_stack_object(const void *obj, unsigned long len) | |||
58 | return GOOD_STACK; | 58 | return GOOD_STACK; |
59 | } | 59 | } |
60 | 60 | ||
61 | static void report_usercopy(const void *ptr, unsigned long len, | 61 | static void report_usercopy(unsigned long len, bool to_user, const char *type) |
62 | bool to_user, const char *type) | ||
63 | { | 62 | { |
64 | pr_emerg("kernel memory %s attempt detected %s %p (%s) (%lu bytes)\n", | 63 | pr_emerg("kernel memory %s attempt detected %s '%s' (%lu bytes)\n", |
65 | to_user ? "exposure" : "overwrite", | 64 | to_user ? "exposure" : "overwrite", |
66 | to_user ? "from" : "to", ptr, type ? : "unknown", len); | 65 | to_user ? "from" : "to", type ? : "unknown", len); |
67 | /* | 66 | /* |
68 | * For greater effect, it would be nice to do do_group_exit(), | 67 | * For greater effect, it would be nice to do do_group_exit(), |
69 | * but BUG() actually hooks all the lock-breaking and per-arch | 68 | * 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 | return; | 260 | return; |
262 | 261 | ||
263 | report: | 262 | report: |
264 | report_usercopy(ptr, n, to_user, err); | 263 | report_usercopy(n, to_user, err); |
265 | } | 264 | } |
266 | EXPORT_SYMBOL(__check_object_size); | 265 | EXPORT_SYMBOL(__check_object_size); |