From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: "Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Christian Brauner" <christian@brauner.io>,
"Carlos Llamas" <cmllamas@google.com>,
"Alice Ryhl" <aliceryhl@google.com>,
linux-kernel@vger.kernel.org, stable <stable@kernel.org>
Subject: Re: [PATCH 7.2.y] rust_binder: reschedule node refcount update on thread exit
Date: Mon, 12 Oct 2026 08:14:50 +0200 [thread overview]
Message-ID: <2026101240-waffle-outboard-97db@gregkh> (raw)
In-Reply-To: <20261011163608.48622-1-ojeda@kernel.org>
On Sun, Oct 11, 2026 at 06:36:08PM +0200, Miguel Ojeda wrote:
> From: Alice Ryhl <aliceryhl@google.com>
>
> commit 2a74ccd1bcc170e66525f34e9de8652b57e2cf3d upstream.
>
> When a thread exits via BINDER_THREAD_EXIT, its pending work items are
> cancelled. If a thread exits while holding a pending node refcount
> increment (e.g. pushed as deferred work to that thread), the refcount
> increment was previously dropped because Node::cancel() and
> NodeWrapper::cancel() were no-ops.
>
> Dropping the refcount update leaves the node's delivery state and count
> state desynchronized, and userspace will not receive the notification,
> which can cause the node to never be freed from the process's nodes tree
> when all external references are dropped.
>
> Fix this by implementing DeliverToRead::cancel() for Node and NodeWrapper
> to move the pending refcount update to the process's work queue on thread
> exit so another thread can deliver it to userspace.
>
> Cc: stable <stable@kernel.org>
> Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> Link: https://patch.msgid.link/20260903-binder-thread-exit-node-v1-1-be09ff14f6a4@google.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [ Dropped first argument in calls to `push_work()` to adjust to the
> existing form without mainline commit dbb17c9ea756 ("rust_binder: move
> (e)poll wait queue to Process"). - Miguel ]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> drivers/android/binder/node.rs | 20 ++++++++++++---
> drivers/android/binder/node/wrapper.rs | 34 +++++++++++++++++++++++++-
> 2 files changed, 50 insertions(+), 4 deletions(-)
>
Both now queued up, thanks.
greg k-h
prev parent reply other threads:[~2026-10-12 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 16:36 Miguel Ojeda
2026-10-12 6:14 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026101240-waffle-outboard-97db@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=christian@brauner.io \
--cc=cmllamas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=stable@kernel.org \
--cc=tkjos@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®