mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carlos Llamas <cmllamas@google.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, "Arve Hjønnevåg" <arve@android.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Todd Kjos" <tkjos@android.com>,
	"Tiffany Y. Yang" <ynaffit@google.com>
Subject: Re: [PATCH] binder: Use %p for pointer formatting
Date: Thu, 24 Sep 2026 22:17:06 +0000	[thread overview]
Message-ID: <arWhYvDBYgLwaY9w@google.com> (raw)
In-Reply-To: <20260918103008.IkhCxRgs@linutronix.de>

On Fri, Sep 18, 2026 at 12:30:08PM +0200, Sebastian Andrzej Siewior wrote:
> Commit 8ca86f1639ec5 ("binder: replace "%p" with "%pK"") introduced the
> %pK modifier in order not to leak kernel pointer.
> Since commit ad67b74d2469d ("printk: hash addresses printed with %p")
> pointers are hashed by default and the behaviour can be controller by
> `hash_pointers' boot argument.
> Commit 57483a362741e ("binder: Create safe versions of binder log
> files") introduced a hashed version while preserving the other interface
> where pointers are returned. This interface is for debugging of memory
> leaks. Ideally it would provide just one interface without leaking
> pointers.

These binder_log files is a different thing. These are userspace
pointers.

> 
> The policy on %p is to not introduce new ones. Rather then removing the
> pointer output make it use %p.

IIUC, the policy is to use %pK for seq_printf() files exposed to users.
This is the relevant section from printk-formats.rst:

 | If (and only if) you are printing addresses as a content of a virtual file in
 | e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a
 | userspace process, use the %pK modifier described below instead of %p or %px.

Has this changed?

> 
> Cc: Tiffany Y. Yang <ynaffit@google.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/android/binder.c | 4 ++--

This file is now deleted anyway.


Cheers,
--
Carlos Llamas

  reply	other threads:[~2026-09-24 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 10:30 Sebastian Andrzej Siewior
2026-09-24 22:17 ` Carlos Llamas [this message]
2026-09-25  7:59   ` Sebastian Andrzej Siewior
2026-09-25 12:01     ` Carlos Llamas
2026-09-25 12:08       ` Sebastian Andrzej Siewior

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=arWhYvDBYgLwaY9w@google.com \
    --to=cmllamas@google.com \
    --cc=aliceryhl@google.com \
    --cc=arve@android.com \
    --cc=bigeasy@linutronix.de \
    --cc=brauner@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tkjos@android.com \
    --cc=ynaffit@google.com \
    /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

all inboxes | Powered by JetHome®