CVE-2025-40213
Description
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MGMT: fix crash in set_mesh_sync and set_mesh_complete
There is a BUG: KASAN: stack-out-of-bounds in set_mesh_sync due to memcpy from badly declared on-stack flexible array.
Another crash is in set_mesh_complete() due to double list_del via mgmt_pending_valid + mgmt_pending_remove.
Use DEFINE_FLEX to declare the flexible array right, and don't memcpy outside bounds.
As mgmt_pending_valid removes the cmd from list, use mgmt_pending_free, and also report status on error.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Bluetooth MGMT set_mesh_sync and set_mesh_complete functions contain bugs leading to stack-out-of-bounds or double list_del, causing kernel crash and potential denial of service.
Vulnerability
A stack-out-of-bounds bug exists in the set_mesh_sync function of the Linux kernel's Bluetooth MGMT subsystem. The issue arises from an incorrectly declared on-stack flexible array, which allows memcpy to write beyond the allocated boundary [1]. Additionally, in set_mesh_complete, a double list_del occurs when both mgmt_pending_valid and mgmt_pending_remove are called on the same pending command, leading to list corruption [2][3].
Exploitation
An attacker with the ability to send crafted Bluetooth MGMT commands can trigger these bugs. The vulnerabilities are reachable from local context or potentially remotely if the Bluetooth interface is exposed. Exploitation does not require authentication if the MGMT interface is accessible.
Impact
Successful exploitation results in a kernel crash (denial of service). The double list_del can corrupt kernel memory, possibly leading to a use-after-free condition. The stack-out-of-bounds may allow limited memory corruption, though further exploitation for privilege escalation is not analyzed in the provided references.
Mitigation
The fixes have been applied to stable kernel branches. The patches use DEFINE_FLEX to correctly declare the flexible array and replace the problematic mgmt_pending_valid/mgmt_pending_remove sequence with mgmt_pending_free, while ensuring proper error reporting [1][2][3]. Users should update to the latest stable kernel to mitigate these vulnerabilities.
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
35c19daa93d9a1c9aca1787e8e8785404de06Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.