]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust_binder: clear freeze listener on node removal
authorAlice Ryhl <aliceryhl@google.com>
Fri, 3 Jul 2026 11:25:12 +0000 (11:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jul 2026 11:54:10 +0000 (13:54 +0200)
commitbc4a9828897871ff3e5a1f8a1d346decbf4ee95e
tree3411a23aeb841abea389ae2ff280b97bd9f838d4
parent6849cabfd30fb5727cfd31e8241e15801e17ebf9
rust_binder: clear freeze listener on node removal

Generally userspace is supposed to explicitly clear freeze listeners
before they drop the refcount on the node ref to zero, but there's
nothing forcing that. Currently, in this scenario the freeze listener
remains in the freeze_listeners rbtree and in the remote node's freeze
listener list, even though the ref for which the listener is registered
is gone. This could potentially lead to a memory leak due to a refcount
cycle. Thus, remove the freeze listener in this scenario.

Cc: stable <stable@kernel.org>
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260703-remove-freeze-on-remove-node-v3-1-6e0c4547af46@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder/freeze.rs
drivers/android/binder/node.rs
drivers/android/binder/process.rs