Re: [BUG] android: rust binder: sleeping function called from invalid context in deferred_release()

Miguel Ojeda
2026-04-11T15:24:37Z

On Sat, Apr 11, 2026 at 3:45 PM syscaller <syscaller@163.com> 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@google.com/

Thanks for the report!

Cheers,
Miguel