Re: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers

Steven Rostedt
2018-03-15T17:07:20Z

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;
> }