HIGH
bluetooth L2CAP Listen Race
CVE-2026-90091
CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI5.6MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: fix race l2cap_sock_cleanup_listen() vs. put_chan For L2CAP sockets without owning sk->sk_socket, reading l2cap_pi(sk)->chan may race against concurrent l2cap_sock_kill() -> l2cap_sock_put_chan(). This excludes simultaneous proto_ops callbacks, but access in l2cap_sock_cleanup_listen() has unsafe lockless read. [Task 1] [Task 2 (hdev->workqueue)] l2cap_sock_release(parent) l2cap_disconn_cfm l2cap_sock_cleanup_listen l2cap_conn_del bt_accept_dequeue l2cap_chan_del lock_sock(sk) l2cap_sock_teardown_cb bt_accept_unlink bt_sk(sk)->parent = NULL release_sock(sk) ----------------> lock_sock(sk) parent = /* NULL */ lock_sock(sk) <--------------------- release_sock(sk) sock_set_flag(sk, SOCK_ZAPPED) l2cap_sock_close_cb l2cap_sock_kill(sk) l2cap_sock_put_chan chan = READ l2cap_pi(sk)->chan l2cap_pi(sk)->chan = NULL l2cap_chan_hold_unless_zero l2cap_put_chan(chan) kref_get_unless_zero(&chan->ref) Task 1 may observe NULL which causes null-ptr-deref. Fix the race by taking lock_sock() in l2cap_sock_kill() to synchronize with l2cap_sock_cleanup_listen(). hold_unless_zero() is not needed here, l2cap_pi(sk)->chan owns reference if it is non-NULL. Clarify code comments vs. locking.
02KernelScan AI Analysis
Risk summary
A race condition in the Bluetooth L2CAP socket cleanup path can lead to a NULL pointer dereference, causing a kernel panic and system crash. An attacker in Bluetooth range could trigger this by establishing and tearing down L2CAP connections to induce the race window. The issue affects any system with an active Bluetooth interface accepting L2CAP connections.
Vulnerability analysis
A race condition in the Bluetooth L2CAP socket cleanup allows one thread to read a connection object pointer while another thread clears it to NULL. When a listening socket is released at the same time a peer disconnects, the cleanup code may read the pointer after it has been cleared and crash the kernel. The fix adds locking so the teardown path cannot modify the pointer while the cleanup path is using it. An attacker within Bluetooth range can trigger this by connecting to and disconnecting from a listening L2CAP socket; no authentication or local privileges are needed.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.12.97 | 6.12.110 | 4f8c63fe0097 |
| 6.18 | 6.18.40 | 6.18.52 | 61d5ddbd524c |
| mainline | — | 7.3-rc1 | — |
| 6.6 | 6.6.145 | 6.6.157 | 7c7ac736b50f |
| 6.1 | 6.1.178 | 6.1.188 | 827de6bd2865 |
| 7.1 | 7.1.5 | 7.2 | 32a7bc6e93be |
| 7.2 | — | 7.2.6 | 66d6ef18548a |
| cip/6.12 | — | 6.12.111-cip32 | 4f8c63fe0097 |