lkml.org 
[lkml]   [2018]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 10/11] vsprintf: WARN() on invalid pointer access
On (04/25/18 13:12), Petr Mladek wrote:
[..]
> /*
> * This is not a fool-proof test. 99% of the time that this will fault is
> * due to a bad pointer, not one that crosses into bad memory. Just test
> @@ -623,8 +626,12 @@ static const char *check_pointer_access(const void *ptr)
> if (!ptr)
> return "(null)";
>
> - if (probe_kernel_address(ptr, byte))
> + /* Prevent silent crashes when called in printk_safe context. */
> + if (probe_kernel_address(ptr, byte)) {
> + WARN(!panic_on_warn && !test_printf_pointer_access,
> + "vsprintf: invalid pointer address\n");
> return "(efault)";
> + }

Can we have a rate-limited print out here? Or may be even a WARN_ONCE()?
Yes, printk()-s from check_pointer_access() are OK, printk_safe() helps us,
but at the same time every single invalid pointer access printk()-message
will log_store() WARN() extra entries. Theoretically, this can harm. What
do you think?

-ss

\
 
 \ /
  Last update: 2018-04-26 03:28    [W:0.223 / U:18.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site