Re: [PATCH] rust_binder: add state_hashed and transactions_hashed files
From: Greg Kroah-Hartman
Date: Tue Oct 13 2026 - 10:45:52 EST
On Fri, Oct 09, 2026 at 05:06:27PM +0000, Carlos Llamas wrote:
> The 'state' and 'transactions' binderfs files print the userspace ptr
> and cookie of each node as raw values, which leaks the userspace memory
> layout and forces access to these files to be heavily restricted. Add
> hashed versions of these files, as done for the C driver in commit
> 57483a362741 ("binder: Create safe versions of binder log files"), so
> that access to them can be granted more broadly.
>
> Pass a 'hashed' flag down the debug_print() chain and print the ptr and
> cookie through a new MaybeHashed helper, which either prints the raw
> value or hashes it like {:p} does. Everything else in the files remains
> unchanged:
>
> $ grep "node 2:" /dev/binderfs/binder_logs/state*
> state: node 2: u000000003cf2c740 c0000000000000000 hs true ...
> state_hashed: node 2: u00000000abab9b6d c0000000000000000 hs true ...
>
> Assisted-by: LLM
> Signed-off-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
> ---
>
> Notes:
> The output of the hashed values depends on this {:p} fix:
> https://lore.kernel.org/all/20261006183857.396710-1-cmllamas@xxxxxxxxxx/
> Without it, the patch still builds and works, but an odd "0x" prefix
> is added to the hashed values, e.g. "u0x00000000abab9b6d".
As that's not merged yet, I'll drop this for now and wait for you to
resubmit this when that is merged properly?
thanks,
greg k-h