linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Kees Cook <keescook@chromium.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] vsprintf: Fix %pK with kptr_restrict == 0
Date: Wed, 9 Feb 2022 13:53:04 +0200	[thread overview]
Message-ID: <YgOrIOLrSfrKE9JO@smile.fi.intel.com> (raw)
In-Reply-To: <YgJ1a0Mi0wEbr88C@alley>

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




      reply	other threads:[~2022-02-09 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 11:11 Christophe Leroy
2022-02-08 13:51 ` Petr Mladek
2022-02-09 11:53   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgOrIOLrSfrKE9JO@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox