* Re: [PATCH] rust_binder: Avoid holding lock when dropping delivered_death
2026-04-03 18:18 [PATCH] rust_binder: Avoid holding lock when dropping delivered_death Matthew Maurer
@ 2026-04-04 8:10 ` Alice Ryhl
2026-04-27 16:39 ` Carlos Llamas
2026-04-28 7:24 ` Alice Ryhl
2 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2026-04-04 8:10 UTC (permalink / raw)
To: Matthew Maurer
Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Christian Brauner, Carlos Llamas, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
Matt Gilbride, Paul Moore, stable, linux-kernel, rust-for-linux,
David Stevens
On Fri, Apr 3, 2026 at 8:19 PM Matthew Maurer <mmaurer@google.com> wrote:
>
> In 6c37bebd8c926, 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@vger.kernel.org
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Thanks
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rust_binder: Avoid holding lock when dropping delivered_death
2026-04-03 18:18 [PATCH] rust_binder: Avoid holding lock when dropping delivered_death Matthew Maurer
2026-04-04 8:10 ` Alice Ryhl
@ 2026-04-27 16:39 ` Carlos Llamas
2026-04-28 7:24 ` Alice Ryhl
2 siblings, 0 replies; 4+ messages in thread
From: Carlos Llamas @ 2026-04-27 16:39 UTC (permalink / raw)
To: Matthew Maurer
Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Christian Brauner, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
Matt Gilbride, Paul Moore, stable, linux-kernel, rust-for-linux,
David Stevens
On Fri, Apr 03, 2026 at 06:18:58PM +0000, Matthew Maurer wrote:
> In 6c37bebd8c926, 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@vger.kernel.org
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
> ---
Acked-by: Carlos Llamas <cmllamas@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rust_binder: Avoid holding lock when dropping delivered_death
2026-04-03 18:18 [PATCH] rust_binder: Avoid holding lock when dropping delivered_death Matthew Maurer
2026-04-04 8:10 ` Alice Ryhl
2026-04-27 16:39 ` Carlos Llamas
@ 2026-04-28 7:24 ` Alice Ryhl
2 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2026-04-28 7:24 UTC (permalink / raw)
To: Matthew Maurer, Greg Kroah-Hartman
Cc: Arve Hjønnevåg, Todd Kjos, Christian Brauner,
Carlos Llamas, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
Matt Gilbride, Paul Moore, stable, linux-kernel, rust-for-linux,
David Stevens
On Fri, Apr 03, 2026 at 06:18:58PM +0000, Matthew Maurer wrote:
> In 6c37bebd8c926, 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@vger.kernel.org
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
I realized this tag should be:
Fixes: 6c37bebd8c92 ("rust_binder: avoid mem::take on delivered_deaths")
Greg, can you fix this on apply, or do you want a new version?
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread