Re: [PATCH v2] rust_binder: add state_hashed and transactions_hashed files
From: Alice Ryhl
Date: Wed Oct 21 2026 - 04:54:14 EST
On Wed, Oct 21, 2026 at 03:32:57AM +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>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>