android_kernel_motorola_sm6375/drivers/android
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tiffany Y. Yang 45cc71553d BACKPORT: binder: Create safe versions of binder log files
Binder defines several seq_files that can be accessed via debugfs or
binderfs. Some of these files (e.g., 'state' and 'transactions')
contain more granular information about binder's internal state that
is helpful for debugging, but they also leak userspace address data
through user-defined 'cookie' or 'ptr' values. Consequently, access
to these files must be heavily restricted.

Add two new files, 'state_hashed' and 'transactions_hashed', that
reproduce the information in the original files but use the kernel's
raw pointer obfuscation to hash any potential user addresses. This
approach allows systems to grant broader access to the new files
without having to change the security policy around the existing ones.

In practice, userspace populates these fields with user addresses, but
within the driver, these values only serve as unique identifiers for
their associated binder objects. Consequently, binder logs can
obfuscate these values and still retain meaning. While this strategy
prevents leaking information about the userspace memory layout in the
existing log files, it also decouples log messages about binder
objects from their user-defined identifiers.

Acked-by: Carlos Llamas <cmllamas@google.com>
Tested-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: "Tiffany Y. Yang" <ynaffit@google.com>
Link: https://lore.kernel.org/r/20250510013435.1520671-7-ynaffit@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 316970771
(cherry picked from commit 57483a362741e4f0f3f4d2fc82d48f82fd0986d9)
[Resolve conflicts from node prio and binder log file init structure]
Change-Id: I6a01048c0105a1d6061e95f386e7ee55e2fdc898
Signed-off-by: "Tiffany Yang" <ynaffit@google.com>
2025-06-10 19:11:56 -07:00
..
binder.c BACKPORT: binder: Create safe versions of binder log files 2025-06-10 19:11:56 -07:00
binder_alloc.c BACKPORT: binder: tell userspace to dump current backtrace when detected oneway spamming 2024-09-07 22:02:42 +00:00
binder_alloc.h BACKPORT: binder: tell userspace to dump current backtrace when detected oneway spamming 2024-09-07 22:02:42 +00:00
binder_alloc_selftest.c
binder_internal.h BACKPORT: binder: Create safe versions of binder log files 2025-06-10 19:11:56 -07:00
binder_trace.h FROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txn 2024-09-07 22:03:08 +00:00
binderfs.c BACKPORT: binder: Create safe versions of binder log files 2025-06-10 19:11:56 -07:00
Kconfig
Makefile
vendor_hooks.c