Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Bluetooth: ISO: Fix parent socket leak in iso_conn_ready()
@ 2026-09-10 18:12 Luiz Augusto von Dentz
  2026-09-10 18:12 ` [PATCH v2 2/2] Bluetooth: ISO: set BT_LISTEN before requesting a BIG sync Luiz Augusto von Dentz
  2026-09-10 20:58 ` [v2,1/2] Bluetooth: ISO: Fix parent socket leak in iso_conn_ready() bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-09-10 18:12 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

iso_get_sock() returns the parent socket with a reference held, which is
dropped by sock_put() once the child socket has been set up. The error
path taken when iso_sock_alloc() fails only calls release_sock() and
returns, leaking the reference and thus the parent socket itself.

Drop the reference on that path as well.

Fixes: b9858430f759 ("Bluetooth: ISO: Fix possible UAF on iso_conn_free")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/iso.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 75bfd5938b2e..4de332b8901f 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -2289,6 +2289,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 				    BTPROTO_ISO, GFP_ATOMIC, 0);
 		if (!sk) {
 			release_sock(parent);
+			sock_put(parent);
 			return;
 		}
 
-- 
2.55.0


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

end of thread, other threads:[~2026-09-10 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 18:12 [PATCH v2 1/2] Bluetooth: ISO: Fix parent socket leak in iso_conn_ready() Luiz Augusto von Dentz
2026-09-10 18:12 ` [PATCH v2 2/2] Bluetooth: ISO: set BT_LISTEN before requesting a BIG sync Luiz Augusto von Dentz
2026-09-10 20:58 ` [v2,1/2] Bluetooth: ISO: Fix parent socket leak in iso_conn_ready() 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