[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201120134242.6cae9e72@gandalf.local.home>
Date: Fri, 20 Nov 2020 13:42:42 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: Printk specifiers for __user pointers
On Fri, 20 Nov 2020 11:44:12 -0500
Alan Stern <stern@...land.harvard.edu> wrote:
> To the VSPRINTF maintainers:
>
> Documentation/core-api/printk-formats.rst lists a large number of format
> specifiers for pointers of various sorts. Yet as far as I can see,
> there is no specifier meant for use with __user pointers.
>
> The security implications of printing the true, unmangled value of a
> __user pointer are minimal, since doing so does not leak any kernel
> information. So %px would work, but tools like checkpatch.pl don't like
> it.
>
> Should a new specifier be added? If not, should we simply use %px?
There's currently no user of '%pu' (although there is a '%pus'. Perhaps we
should have a '%pux'?
I would even state that if it is used, that if makes sure that the value is
indeed a user space pointer (goes through the same checks as accessing user
space), before its printed, otherwise it shows "(fault)" or something.
-- Steve
Powered by blists - more mailing lists