lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers
On Thu, 15 Mar 2018 16:07:54 +0100
Petr Mladek <pmladek@suse.com> wrote:

> Good point. The following should do the job:
>
> static const char *check_pointer_access(const void *ptr)
> {
> char c;
>
> if (!ptr)
> return "(null)";
>
> if ((unsigned long)ptr < TASK_SIZE || probe_kernel_address(ptr, c))

Please don't.

-- Steve

> return "(efault)";
>
> return 0;
> }

\
 
 \ /
  Last update: 2018-03-15 18:07    [W:0.146 / U:2.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site