[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YgOrIOLrSfrKE9JO@smile.fi.intel.com>
Date: Wed, 9 Feb 2022 13:53:04 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Kees Cook <keescook@...omium.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] vsprintf: Fix %pK with kptr_restrict == 0
On Tue, Feb 08, 2022 at 02:51:39PM +0100, Petr Mladek wrote:
> On Thu 2022-01-27 11:11:02, Christophe Leroy wrote:
...
> Instead, I would create:
>
> /*
> * default is to _not_ leak addresses, so hash before printing,
> * unless no_hash_pointers is specified on the command line.
> */
> static noinline_for_stack
> char *default_pointer(const char *fmt, char *buf, char *end, void *ptr,
> struct printf_spec spec)
> {
> if (unlikely(no_hash_pointers))
> return pointer_string(buf, end, ptr, spec);
>
> return ptr_to_id(buf, end, ptr, spec);
> }
>
> and use it in both hash_pointer() and pointer().
I like this idea.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists