Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_add_adv_monitor()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_add_adv_monitor()
KSAN reports use-after-free in hci_add_adv_monitor().
While adding an adv monitor, hci_add_adv_monitor() calls -> msft_add_monitor_pattern() calls -> msft_add_monitor_sync() calls -> msft_le_monitor_advertisement_cb() calls in an error case -> hci_free_adv_monitor() which frees the *moniter.
This is referenced by bt_dev_dbg() in hci_add_adv_monitor().
Fix the bt_dev_dbg() by using handle instead of monitor->handle.
From the CVE record · Linux
The Linux kernel’s Bluetooth hci_add_adv_monitor() can reference a freed advertising monitor while adding it if an error path frees the monitor first. This creates a use-after-free; the input does not specify how an attacker could trigger it or whether access or user interaction is required.
Engineers running the Linux kernel should check whether their version includes the Bluetooth hci_sync fix; affected versions are not specified.