CVE-2026-139085: Bluetooth: L2CAP: fix race condition in l2cap_sock_shutdown()
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: fix race condition in l2capsockshutdown()
l2capsockshutdown() has the race condition
[Task 1] [Task 2] l2capsockshutdown l2capsockconnect l2capchanlock l2capchanconnect conn = ... / == NULL/ l2capchanunlock ------------> l2capchanlock if (conn) / false / l2capchanadd(conn, chan) l2capchanlock <-------------- l2capchanunlock l2capchanclose / chan->conn->lock not held! /
conn->lock protects conn->chanl and is not properly held here.
Use the l2capchancloseunlocked() helper that ensures conn->lock is held for l2capchanclose().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Use l2cap_chan_close_unlocked() for l2cap_chan_close() so conn->lock is held.
Event History
Frequently Asked Questions
What kernel component is affected by this race condition?
The issue is in the Linux kernel Bluetooth L2CAP socket shutdown path, specifically l2cap_sock_shutdown(). It involves concurrent shutdown and connection handling for an L2CAP channel.
What condition is required for the race to occur?
The race requires l2cap_sock_shutdown() and l2cap_sock_connect() to operate concurrently on an L2CAP channel. During that interleaving, the channel may be closed without the connection lock that protects the connection channel list.
What is the remediation described by the fix?
The fix changes the shutdown path to use l2cap_chan_close_unlocked(), which ensures that conn->lock is held when l2cap_chan_close() is performed. The provided references point to the stable kernel commits containing the correction.