From: Hui Peng <benquike@gmail.com>
To: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com,
maco@android.com, brauner@kernel.org, cmllamas@google.com
Cc: maco@google.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Hui Peng <benquike@gmail.com>
Subject: [PATCH v2 0/2] binder: fix premature fd_install() and buffer leak on read -EFAULT
Date: Thu, 24 Sep 2026 10:00:17 +0000 [thread overview]
Message-ID: <20260924100019.3389555-1-benquike@gmail.com> (raw)
In-Reply-To: <20260919213650.3316812-1-benquike@gmail.com>
This series fixes two error-handling issues in binder_thread_read():
1. Defer fd_install() until after put_user() and copy_to_user() succeed,
preventing file descriptors from being prematurely installed into the
recipient process's file descriptor table when userspace copy fails.
2. Call binder_free_buf() on -EFAULT error paths in binder_thread_read() so
the transaction buffer and associated node/ref references are freed.
Changes in v2:
- Split into a 2-patch series with separate single-purpose commits as
requested by Greg Kroah-Hartman and Carlos Llamas.
- Added Reviewed-by tag from Carlos Llamas.
Hui Peng (2):
binder: defer fd_install() until after copy_to_user() in binder_thread_read()
binder: free transaction buffer via binder_free_buf() on read -EFAULT
drivers/android/binder.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
next prev parent reply other threads:[~2026-09-24 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 21:36 [PATCH] binder: fix buffer/node leak and premature fd_install " Hui Peng
2026-09-23 22:54 ` Carlos Llamas
2026-09-24 10:00 ` Hui Peng [this message]
2026-09-24 10:00 ` [PATCH v2 1/2] binder: defer fd_install() until after copy_to_user() in binder_thread_read() Hui Peng
2026-09-24 10:00 ` [PATCH v2 2/2] binder: free transaction buffer via binder_free_buf() on read -EFAULT Hui Peng
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=20260924100019.3389555-1-benquike@gmail.com \
--to=benquike@gmail.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=maco@google.com \
--cc=stable@vger.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®