Re: [BUG] android: rust binder: sleeping function called from invalid context in deferred_release()
From: Miguel Ojeda
Date: Sat Apr 11 2026 - 11:25:13 EST
On Sat, Apr 11, 2026 at 3:45 PM syscaller <syscaller@xxxxxxx> wrote:
>
> I believe the warning is caused by the following code in
> drivers/android/binder/process.rs:
>
> while let Some(delivered_death) =
> { self.inner.lock().delivered_deaths.pop_front() } {
> drop(delivered_death);
> }
>
> The temporary SpinLockGuard returned by self.inner.lock() appears to live
> across the whole while-let statement, including the loop body. As a result,
> drop(delivered_death) runs while Process::inner is still held.
Please take a look at:
https://lore.kernel.org/rust-for-linux/20260403-lockhold-v1-1-c332b56cd8ae@xxxxxxxxxx/
Thanks for the report!
Cheers,
Miguel