CVE-2025-40318
Description
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_sync: fix race in hci_cmd_sync_dequeue_once
hci_cmd_sync_dequeue_once() does lookup and then cancel the entry under two separate lock sections. Meanwhile, hci_cmd_sync_work() can also delete the same entry, leading to double list_del() and "UAF".
Fix this by holding cmd_sync_work_lock across both lookup and cancel, so that the entry cannot be removed concurrently.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in Linux Bluetooth's hci_cmd_sync_dequeue_once() can cause a use-after-free due to improper locking between lookup and cancel operations.
Vulnerability
Overview
CVE-2025-40318 is a race condition vulnerability in the Linux kernel's Bluetooth subsystem, specifically within hci_sync. The function hci_cmd_sync_dequeue_once() performs a lookup and then cancels an entry under two separate lock sections. This allows a concurrent execution of hci_cmd_sync_work(), which can delete the same entry, leading to a double list_del() and a use-after-free (UAF) condition [1].
Exploitation
Path
An attacker may exploit this race by causing the Bluetooth subsystem to process commands concurrently, triggering the window between the lookup and cancel operations. No special privileges are required beyond the ability to interact with the Bluetooth stack, which may be accessible to unprivileged users in certain configurations. The vulnerability is local and requires timing to win the race.
Impact
Successful exploitation could allow an attacker to corrupt kernel memory, leading to a denial of service (system crash) or potentially arbitrary code execution in the kernel context, depending on the attacker's ability to control the freed memory [2]. The issue affects the stability and security of systems using Bluetooth.
Mitigation
The fix ensures that cmd_sync_work_lock is held across both the lookup and cancel operations, preventing concurrent removal. Patches have been committed to the Linux kernel stable tree and are available as updates. Users should apply the latest kernel updates to mitigate this vulnerability [1].
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
50a94f7e01743932c0a4f77acae76cf6c2c849cd53697019209b0cd1297b4Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- git.kernel.org/stable/c/09b0cd1297b4dbfe736aeaa0ceeab2265f47f772nvd
- git.kernel.org/stable/c/0a94f7e017438935c09ef833a1aa908ad9875213nvd
- git.kernel.org/stable/c/932c0a4f77ac13e526fdd5b42914d29c9821d389nvd
- git.kernel.org/stable/c/9cd536970192b72257afcdfba0bfc09993e6f19cnvd
- git.kernel.org/stable/c/ae76cf6c2c842944c6514c57df54d728f1916553nvd
News mentions
0No linked articles in our index yet.