Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 6.1.y] Bluetooth: ISO: drop unbalanced sock_put() in iso_conn_ready()
@ 2026-11-02 12:34 Andrey Misiurov
  2026-11-02 19:32 ` [6.1.y] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Misiurov @ 2026-11-02 12:34 UTC (permalink / raw)
  To: stable
  Cc: gregkh, sashal, luiz.dentz, luiz.von.dentz, marcel, johan.hedberg,
	linux-bluetooth, 2122295973, Andrey Misiurov

Commit 1702f12cf59a ("Bluetooth: ISO: fix use-after-free of listener
socket in iso_conn_ready"), the 6.1.y backport of upstream 560bef609fa5,
puts the listener when it is no longer listening. Upstream that put
balances the reference taken by iso_get_sock(). On 6.1.y
iso_get_sock_listen() takes no reference (it got one only in v6.8 with
fa224d0c094a), and no other exit of iso_conn_ready() puts the parent.

No race is needed to hit it: shutdown() of a bound socket sets
SOCK_ZAPPED and keeps BT_BOUND, so listen() still succeeds and the
listener stays BT_LISTEN with SOCK_ZAPPED. Every incoming connection
then takes the new branch, and the second one frees the listener while
it is still on iso_sk_list and attached to its file.

Drop the put.

Found while reviewing a backport of this fix; not reproduced at
runtime.

Fixes: 1702f12cf59a ("Bluetooth: ISO: fix use-after-free of listener socket in iso_conn_ready")
Signed-off-by: Andrey Misiurov <amisiurov@cloudlinux.com>
---
6.1.y only: 6.6.y and later have the reference-taking lookup.

The closed-listener race that 560bef609fa5 fixes does not free the
listener on 6.1.y: iso_sock_release() calls sock_orphan() before
iso_sock_kill(), which then returns early on SOCK_DEAD, so a released
ISO socket is never freed (fixed upstream by ce57442a3792 "Bluetooth:
ISO: fix leaking sk after socket release", not in 6.1.y). If that
commit is backported, iso_get_sock_listen() needs to take a reference
as upstream does.

 net/bluetooth/iso.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1536,7 +1536,6 @@ static void iso_conn_ready(struct iso_conn *conn)
 		if (parent->sk_state != BT_LISTEN ||
 		    sock_flag(parent, SOCK_ZAPPED)) {
 			release_sock(parent);
-			sock_put(parent);
 			return;
 		}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [6.1.y] Bluetooth: ISO: drop unbalanced sock_put() in iso_conn_ready()
  2026-11-02 12:34 [PATCH 6.1.y] Bluetooth: ISO: drop unbalanced sock_put() in iso_conn_ready() Andrey Misiurov
@ 2026-11-02 19:32 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-02 19:32 UTC (permalink / raw)
  To: linux-bluetooth, amisiurov

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1198824/

---Test result---

Test Summary:
CheckPatch                    PASS      0.79 seconds
VerifyFixes                   PASS      0.13 seconds
VerifySignedoff               PASS      0.40 seconds
GitLint                       PASS      0.35 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      30.09 seconds
CheckAllWarning               PASS      34.29 seconds
CheckSparse                   PASS      36.95 seconds
BuildKernel32                 PASS      30.17 seconds
CheckKernelLLVM               PASS      31.51 seconds
TestRunnerSetup               PASS      694.21 seconds
TestRunner_iso-tester         PASS      11.54 seconds
IncrementalBuild              PASS      28.16 seconds



https://github.com/bluez/bluetooth-next/pull/1042

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-02 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 12:34 [PATCH 6.1.y] Bluetooth: ISO: drop unbalanced sock_put() in iso_conn_ready() Andrey Misiurov
2026-11-02 19:32 ` [6.1.y] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox