UBUNTU-CVE-2026-98246: Use After Free
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hcisync: Serialize local codec list cleanup hcidevclosesync() clears hdev->localcodecs after releasing hdev->lock. Codec list additions and both traversals in scosockgetsockopt() use that lock, but the close path does not. A close and BTCODEC query can therefore interleave as follows: hcidevclosesync() scosockgetsockopt() hcidevlock() fetch codec entry hcicodeclistclear() kfree(entry) read entry->id The reader then accesses an entry which the close path has freed. KASAN BUG: KASAN: slab-use-after-free in scosockgetsockopt+0xfa0/0xfe0 Read of size 1 at addr ffff8881001c3450 Call Trace: scosockgetsockopt+0xfa0/0xfe0 dosockgetsockopt+0x537/0x7b0 sysgetsockopt+0xf2/0x170 Allocated by task 92: hcicodeclistadd.isra.0+0x2c/0x440 hcireadcodeccapabilities+0x224/0x590 hcireadsupportedcodecs+0x2c2/0x640 Freed by task 92: kfree+0x131/0x3c0 hcicodeclistclear+0xd8/0x160 hcidevclosesync+0x92a/0xfa0 Take hdev->lock around the clear operation at its existing point in the close path. This makes the clear wait for active readers and prevents a new traversal until the list is empty without changing teardown ordering.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In the Linux kernel Bluetooth hci_sync close path, take hdev->lock around the hci_codec_list_clear() operation at its existing point, so cleanup waits for active readers and prevents new traversals until the list is empty.
Event History
Frequently Asked Questions
What conditions are required to trigger the use-after-free?
The race requires the Bluetooth device close path to run while a SCO socket performs a BT_CODEC getsockopt query. The query must traverse the local codec list as hci_dev_close_sync() clears and frees entries from that list.
Which Ubuntu kernel package variants are listed as affected?
The listed software includes ubuntu/linux-riscv, ubuntu/linux-realtime, ubuntu/linux-azure, ubuntu/linux-gcp, ubuntu/linux-azure-fde, ubuntu/linux-gke, ubuntu/linux-hwe-edge, and ubuntu/linux-gkeop.
What does the upstream fix change?
The fix takes hdev->lock around local codec-list cleanup in the device close path. This makes cleanup wait for active readers and blocks new list traversals until the list has been cleared.