Re: [PATCH 1/2] rust_binder: reject sync transaction with pending sync work
From: Chris Wiseman
Date: Mon Nov 09 2026 - 15:41:37 EST
On Mon, Nov 09, 2026 at 07:15:34PM +0000, Carlos Llamas wrote:
> If the issue happens when there is already a pending transaction, would
> it be better to relocate the new check to top_of_transaction_stack(),
> before we execute Transaction::new()? If possible, we can skip all the
> unwinding associated with this. If not....
> Reviewed-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
Good catch - moving the check into top_of_transaction_stack() is much
cleaner.
Since the thread is not in process.ready_threads during the write phase
and is at the tip of its own transaction chain, no new incoming
synchronous transaction can be queued onto inner.work_list while
self.inner.lock() is dropped across Transaction::new(). Checking
inner.work_list inside top_of_transaction_stack() (where
self.inner.lock() is already held) lets us fail fast before
Transaction::new() allocates the target buffer or translates binder
objects.
I will move the check into top_of_transaction_stack() in v2 with your
Reviewed-by.
Thanks,
Chris