Linux: Bluetooth: hci_core: Serialize fragmented ISO packet queueing
What fixes it
- 545fa70f730eb648a610a2f4b2d270865f77b619LinuxCVE List
- 708cdd203d0bbcf9255fffb2e4c308d5b28851a7LinuxCVE List
- 1a572db43c057566771b485598ad2e66cb390821LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_core: Serialize fragmented ISO packet queueing
The fragmented path in hci_queue_iso() calls __skb_queue_tail() without holding conn->data_q.lock. The socket lock serializes senders, but the transmit worker can concurrently remove packets from this queue using skb_dequeue().
After an insertion saves the old tail pointer, hci_sched_iso() can dequeue that packet and pass it to the driver. The driver can free the packet before the insertion resumes and writes to the old tail's next pointer, causing a use-after-free. Concurrent updates can also corrupt the queue.
KASAN reported:
BUG: KASAN: slab-use-after-free in hci_send_iso+0xc7d/0xe10 Call Trace: hci_send_iso+0xc7d/0xe10 iso_sock_sendmsg+0x710/0x900 __sys_sendto+0x34a/0x3a0
Allocated by task 86: __alloc_skb+0xdd/0x820 alloc_skb_with_frags+0x7e/0x770 sock_alloc_send_pskb+0x67a/0x820 bt_skb_sendmsg.constprop.0+0xc0/0x6c0 iso_sock_sendmsg+0x44e/0x900
Freed by task 90: kmem_cache_free+0xcb/0x3d0 vhci_read+0x33f/0x4d0 vfs_read+0x177/0xa20
Hold the queue lock across the entire fragment batch, as hci_queue_acl() does, to serialize insertion against dequeue while preserving fragment ordering.
Text from CVE List
Affected versions 12
- Linuxaffected: 26afbd826ee326e63a334c37fd45e82e50a615ec before 545fa70f730eb648a610a2f4b2d270865f77b619CVE List
- Linuxaffected: 26afbd826ee326e63a334c37fd45e82e50a615ec before d6d709981208567868c5c01ebd1bec5e5e7fdab0CVE List
- Linuxaffected: 26afbd826ee326e63a334c37fd45e82e50a615ec before 708cdd203d0bbcf9255fffb2e4c308d5b28851a7CVE List
- Linuxaffected: 26afbd826ee326e63a334c37fd45e82e50a615ec before a7161730a3ab3f0a3896000db7ab0284683936e6CVE List
- Linuxaffected: 26afbd826ee326e63a334c37fd45e82e50a615ec before 1a572db43c057566771b485598ad2e66cb390821CVE List
- Linuxaffected: 6.0CVE List
- Linuxunaffected: all versions before 6.0CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.113 through 6.12.*CVE List
- Linuxunaffected: 6.18.56 through 6.18.*CVE List
- Linuxunaffected: 7.2.10 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/545fa70f730eb648a610a2f4b2d270865f77b619Referencevia CVE List
- git.kernel.org/stable/c/d6d709981208567868c5c01ebd1bec5e5e7fdab0Referencevia CVE List
- git.kernel.org/stable/c/708cdd203d0bbcf9255fffb2e4c308d5b28851a7Referencevia CVE List
- git.kernel.org/stable/c/a7161730a3ab3f0a3896000db7ab0284683936e6Referencevia CVE List
- git.kernel.org/stable/c/1a572db43c057566771b485598ad2e66cb390821Referencevia CVE List