Bluetooth: mgmt: fix UAF in pair command cancellation
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 6.1.184, 6.6.151, 6.12.103, 6.18.44, 7.1.8
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: mgmt: fix UAF in pair command cancellation The pairing completion and authentication failure callbacks look up the pending MGMT_OP_PAIR_DEVICE command by walking hdev->mgmt_pending. The lookup returned a command that was still linked on the shared pending list, without keeping mgmt_pending_lock held for the later dereference and removal. A concurrent MGMT_OP_CANCEL_PAIR_DEVICE request can remove and free the same pending command before the callback uses it. The reverse race is also possible when cancel_pair_device() gets a command from pending_find() and a callback removes it before the cancel path dereferences it. This can lead to a use-after-free and a second list_del(). Make the pairing lookup helpers transfer ownership of the pending command by removing it from hdev->mgmt_pending while holding mgmt_pending_lock. The callbacks and cancel path then complete the command and free it directly, so racing paths cannot find or free the same command again. Take a temporary hci_conn reference in cancel_pair_device() because the command completion drops the reference stored in the pending command.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in 50af4280a587c9971b5388cbc438f1324e626b7b; From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in 86ed4dd6548ccf277bc691bc912ca06e76b9d80c; From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in 7c2a152a897cd1c184b2051484d4f74d803e7f4a; From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in c569def320aa8b1fde89227e2ea96606790fd86d; From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in 51be7280980fddc90ebe874a69c2fe8ab02bb46a; From e9a416b5ce0c0f93819f55d34cf6882196e9c3b2 · fixed in d0a7b48ad0921bd88effaee10bf970ab1d5d0ddd
- Linux Linux
2.6.39
- KernelLinux
From 2.6.39 · fixed in 6.1.184; From 6.2.0 · fixed in 6.6.151; From 6.7.0 · fixed in 6.12.103; From 6.13.0 · fixed in 6.18.44; From 6.19.0 · fixed in 7.1.8