HIGH
bluetooth HciConn UAF
CVE-2025-68304
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_core: lookup hci_conn on RX path on protocol side The hdev lock/lookup/unlock/use pattern in the packet RX path doesn't ensure hci_conn* is not concurrently modified/deleted. This locking appears to be leftover from before conn_hash started using RCU commit bf4c63252490b ("Bluetooth: convert conn hash to RCU") and not clear if it had purpose since then. Currently, there are code paths that delete hci_conn* from elsewhere than the ordered hdev->workqueue where the RX work runs in. E.g. commit 5af1f84ed13a ("Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync") introduced some of these, and there probably were a few others before it. It's better to do the locking so that even if these run concurrently no UAF is possible. Move the lookup of hci_conn and associated socket-specific conn to protocol recv handlers, and do them within a single critical section to cover hci_conn* usage and lookup. syzkaller has reported a crash that appears to be this issue: [Task hdev->workqueue] [Task 2] hci_disconnect_all_sync l2cap_recv_acldata(hcon) hci_conn_get(hcon) hci_abort_conn_sync(hcon) hci_dev_lock hci_dev_lock hci_conn_del(hcon) v-------------------------------- hci_dev_unlock hci_conn_put(hcon) conn = hcon->l2cap_data (UAF)
02KernelScan AI Analysis
Risk summary
Local attackers with low privileges can trigger a use-after-free in Bluetooth HCI connection handling, potentially leading to kernel memory corruption, privilege escalation, or system crashes. Systems with Bluetooth enabled and allowing unprivileged access are at risk.
Vulnerability analysis
The vulnerability stems from a race condition in the Bluetooth HCI packet receive path where hci_conn structures can be concurrently deleted while being accessed. The original code used a lock/lookup/unlock/use pattern that didn't protect against concurrent deletion of hci_conn objects from other contexts like hci_disconnect_all_sync. The fix moves the hci_conn lookup into the protocol-specific receive handlers (L2CAP, SCO, ISO) and performs the lookup and usage within a single critical section, preventing the use-after-free condition. The attack surface is local since Bluetooth operations require local system access, but can be triggered by low-privilege users through Bluetooth socket operations.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.17 | 6.17.11 | — |
| 6.2 | 6.2 | ec74cdf77310 |
| 6.5 | 6.5 | 79a2d4678ba9 |
| 6.6 | 6.6 | — |
| mainline | 6.18 | — |