author | Kees Cook <keescook@chromium.org> | 2018-01-02 20:15:53 (GMT) |
---|---|---|
committer | Alistair Strachan <astrachan@google.com> | 2019-03-29 04:13:05 (GMT) |
commit | 6d698fb4d76693749eff969204495f96eeabaf6a (patch) | |
tree | 687867c736136cd898f975de6748a1516307a256 | |
parent | 4d800a65de06fa025e1e830ed42541c805f6b066 (diff) | |
download | common-6d698fb4d76693749eff969204495f96eeabaf6a.zip common-6d698fb4d76693749eff969204495f96eeabaf6a.tar.gz common-6d698fb4d76693749eff969204495f96eeabaf6a.tar.bz2 |
UPSTREAM: 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>
(cherry picked from commit 4f5e838605c264fcf16c3ff9495bd83da99acc6a)
Signed-off-by: Sandeep Patil <sspatil@android.com>
Bug: 4f5e838605c264fcf16c3ff9495bd83da99acc6a
Test: Build and boot cuttlefish
Change-Id: I361837fa62ab77b2299af78d8f806ed42b236203
-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 3c8da0a..705490b 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -61,12 +61,11 @@ static noinline int check_stack_object(const void *obj, unsigned long len) return GOOD_STACK; } -static void report_usercopy(const void *ptr, unsigned long len, - bool to_user, const char *type) +static void report_usercopy(unsigned long len, 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 ? "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(), * but BUG() actually hooks all the lock-breaking and per-arch @@ -275,6 +274,6 @@ void __check_object_size(const void *ptr, unsigned long n, bool to_user) return; report: - report_usercopy(ptr, n, to_user, err); + report_usercopy(n, to_user, err); } EXPORT_SYMBOL(__check_object_size); |