From: Alice Ryhl <aliceryhl@google.com>
To: Carlos Llamas <cmllamas@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Christian Brauner" <brauner@kernel.org>,
"Li Li" <dualli@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] binder: fix UAF in binder_netlink_report()
Date: Fri, 23 Jan 2026 09:18:01 +0000 [thread overview]
Message-ID: <aXM8ybQ60WW2Z1A4@google.com> (raw)
In-Reply-To: <20260122180203.1502637-1-cmllamas@google.com>
On Thu, Jan 22, 2026 at 06:02:02PM +0000, Carlos Llamas wrote:
> Oneway transactions sent to frozen targets via binder_proc_transaction()
> return a BR_TRANSACTION_PENDING_FROZEN error but they are still treated
> as successful since the target is expected to thaw at some point. It is
> then not safe to access 't' after BR_TRANSACTION_PENDING_FROZEN errors
> as the transaction could have been consumed by the now thawed target.
>
> This is the case for binder_netlink_report() which derreferences 't'
> after a pending frozen error, as pointed out by the following KASAN
> report:
>
> ==================================================================
> BUG: KASAN: slab-use-after-free in binder_netlink_report.isra.0+0x694/0x6c8
> Read of size 8 at addr ffff00000f98ba38 by task binder-util/522
>
> CPU: 4 UID: 0 PID: 522 Comm: binder-util Not tainted 6.19.0-rc6-00015-gc03e9c42ae8f #1 PREEMPT
> Hardware name: linux,dummy-virt (DT)
> Call trace:
> binder_netlink_report.isra.0+0x694/0x6c8
> binder_transaction+0x66e4/0x79b8
> binder_thread_write+0xab4/0x4440
> binder_ioctl+0x1fd4/0x2940
> [...]
>
> Allocated by task 522:
> __kmalloc_cache_noprof+0x17c/0x50c
> binder_transaction+0x584/0x79b8
> binder_thread_write+0xab4/0x4440
> binder_ioctl+0x1fd4/0x2940
> [...]
>
> Freed by task 488:
> kfree+0x1d0/0x420
> binder_free_transaction+0x150/0x234
> binder_thread_read+0x2d08/0x3ce4
> binder_ioctl+0x488/0x2940
> [...]
> ==================================================================
>
> Instead, make a transaction copy so the data can be safely accessed by
> binder_netlink_report() after a pending frozen error. While here, add a
> comment about not using t->buffer in binder_netlink_report().
>
> Cc: stable@vger.kernel.org
> Fixes: 63740349eba7 ("binder: introduce transaction reports via netlink")
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
prev parent reply other threads:[~2026-01-23 9:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 14:50 [PATCH] binder: fix UAF in binder_netlink_report() Carlos Llamas
2026-01-21 15:24 ` Alice Ryhl
2026-01-21 16:56 ` Carlos Llamas
2026-01-22 8:27 ` Alice Ryhl
2026-01-22 17:48 ` Carlos Llamas
2026-01-22 18:02 ` [PATCH v2] " Carlos Llamas
2026-01-23 9:18 ` Alice Ryhl [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=aXM8ybQ60WW2Z1A4@google.com \
--to=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=dualli@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--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