[PATCH v3] binder: frozen notification
From: Yu-Ting Tseng
Date: Mon Jun 24 2024 - 13:22:26 EST
Yu-Ting Tseng (1):
binder: frozen notification
drivers/android/binder.c | 300 +++++++++++++++++++++++++++-
drivers/android/binder_internal.h | 23 ++-
include/uapi/linux/android/binder.h | 35 ++++
3 files changed, 354 insertions(+), 4 deletions(-)
> freeze was allocated with kzalloc(), you could drop the "= false".
Done.
> If !node->proc then process is dead. Do we really need to continue?
Update the code to return an error early if the process is already dead.
> This access to node->proc->* doesn't seem safe
Added locking.
> Why do we queue this notification?
Yes, this is to get the current state back to userspace. The userspace API delivers an initial event for the current state upon a listener registration, which makes it easier to track what the latest state is.
> I'm looking at the death notification code and it seems it only queues a
BR_ERROR after failing to allocate a "death" and that other errors are
silently ignored?
Sure. Please let me know if you think we need a change here.
> these could be just bitfields.
Done
> freeze->work.type = BINDER_WORK_CLEAR_DEATH_NOTIFICATION
Fixed. Working on a userspace test. Will post a link when it's ready.
base-commit: 14d7c92f8df9c0964ae6f8b813c1b3ac38120825
--
2.45.2.741.gdbec12cfda-goog