From: Tomer Pomeranc <tomerpo@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com,
brauner@kernel.org, cmllamas@google.com, aliceryhl@google.com,
stable@vger.kernel.org, Tomer Pomeranc <tomerpo@gmail.com>
Subject: [PATCH 1/2] binder: fix leaked fd fixups on TF_UPDATE_TXN supersede
Date: Wed, 12 Aug 2026 22:53:15 +0300 [thread overview]
Message-ID: <20260812195316.259136-2-tomerpo@gmail.com> (raw)
In-Reply-To: <20260812195316.259136-1-tomerpo@gmail.com>
When a TF_UPDATE_TXN transaction supersedes a pending async transaction
in a frozen process, the outdated transaction is freed with kfree()
directly. This skips binder_free_txn_fixups(), leaking all
binder_txn_fd_fixup entries and their fget()'d struct file references.
The leaked file refcounts never reach zero, so the struct file objects
are permanently pinned in memory. They survive process exit and
accumulate across invocations until file-max exhaustion.
Every other transaction cleanup path (binder_free_transaction(),
binder_transaction() error paths, binder_release_work()) correctly
calls binder_free_txn_fixups(). Add the missing call before kfree()
in the t_outdated cleanup block.
Fixes: 9864bb480133 ("binder: add TF_UPDATE_TXN to replace outdated txn")
Cc: stable@vger.kernel.org
Signed-off-by: Tomer Pomeranc <tomerpo@gmail.com>
---
drivers/android/binder.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 8f2ef1bd5..f70aeb63a 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2932,6 +2932,7 @@ static int binder_proc_transaction(struct binder_transaction *t,
trace_binder_transaction_update_buffer_release(buffer);
binder_release_entire_buffer(proc, NULL, buffer, false);
binder_alloc_free_buf(&proc->alloc, buffer);
+ binder_free_txn_fixups(t_outdated);
kfree(t_outdated);
binder_stats_deleted(BINDER_STAT_TRANSACTION);
}
--
2.34.1
next prev parent reply other threads:[~2026-08-12 19:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 19:53 [PATCH 0/2] binder: fix TF_UPDATE_TXN supersede cleanup bugs Tomer Pomeranc
2026-08-12 19:53 ` Tomer Pomeranc [this message]
2026-08-12 21:31 ` [PATCH 1/2] binder: fix leaked fd fixups on TF_UPDATE_TXN supersede Carlos Llamas
2026-08-12 19:53 ` [PATCH 2/2] binder: fix is_failure flag for superseded transaction cleanup Tomer Pomeranc
2026-08-12 21:31 ` Carlos Llamas
2026-08-12 21:30 ` [PATCH 0/2] binder: fix TF_UPDATE_TXN supersede cleanup bugs Carlos Llamas
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=20260812195316.259136-2-tomerpo@gmail.com \
--to=tomerpo@gmail.com \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.