mirror-linux/drivers/android/binder
Matthew Maurer f6d8fea9e3 rust_binder: Avoid holding lock when dropping delivered_death
In 6c37bebd8c, we switched to looping over the list and dropping each
individual node, ostensibly without the lock held in the loop body.

If the kernel were using Rust Edition 2024, the comment would be
accurate, and the lock would not be held across the drop. However, the
kernel is currently using 2021, so tail expression lifetime extension
results in the lock being held across the drop. Explicitly binding the
expression result to a variable makes the lockguard no longer part of a
tail expression, causing the lock to be dropped before entering the loop
body.

This was detected via `CONFIG_PROVE_LOCKING` identifying an invalid wait
context at the drop site.

Reported-by: David Stevens <stevensd@google.com>
Signed-off-by: Matthew Maurer <mmaurer@google.com>
Cc: stable <stable@kernel.org>
Fixes: 6c37bebd8c ("rust_binder: avoid mem::take on delivered_deaths")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://patch.msgid.link/20260403-lockhold-v1-1-c332b56cd8ae@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-05-22 11:55:48 +02:00
..
node
range_alloc rust: allow `clippy::collapsible_if` globally 2026-04-30 23:21:31 +02:00
Makefile rust: declare cfi_encoding for lru_status 2026-04-07 10:00:25 +02:00
allocation.rs rust_binder: avoid calling pending_oneway_finished() on TF_UPDATE_TXN 2026-05-22 11:55:33 +02:00
context.rs rust_binder: shrink all_procs when deregistering processes 2026-02-26 21:37:53 -08:00
deferred_close.rs
defs.rs
error.rs rust_binder: introduce TransactionInfo 2026-03-31 15:13:56 +02:00
freeze.rs Rust changes for v6.19 2025-12-03 14:16:49 -08:00
node.rs rust_binder: add binder_transaction tracepoint 2025-12-29 12:14:52 +01:00
page_range.rs mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
process.rs rust_binder: Avoid holding lock when dropping delivered_death 2026-05-22 11:55:48 +02:00
rust_binder.h rust_binder: add fd translation tracepoints 2026-04-01 12:18:22 +02:00
rust_binder_events.c
rust_binder_events.h rust_binder: add `command`/`return` tracepoints 2026-04-01 12:18:22 +02:00
rust_binder_internal.h
rust_binder_main.rs Char/Misc/IIO/and others driver updates for 7.1-rc1 2026-04-24 13:23:50 -07:00
rust_binderfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
stats.rs rust_binder: Switch to kernel::sync atomic primitives 2026-01-09 19:01:41 +08:00
thread.rs rust_binder: add `command`/`return` tracepoints 2026-04-01 12:18:22 +02:00
trace.rs rust_binder: add `command`/`return` tracepoints 2026-04-01 12:18:22 +02:00
transaction.rs rust_binder: avoid calling pending_oneway_finished() on TF_UPDATE_TXN 2026-05-22 11:55:33 +02:00