Bluetooth: fix memory leak in error path of hci_alloc_dev()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1d6123102e9fbedc8d25bf4731da6d513173e49e · < f82799407a50af7bcacacf09cc9b279af8fe9b81| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: fix memory leak in error path of hci_alloc_dev()
Early failures in Bluetooth HCI UART configuration leak SRCU percpu memory.
When device initialization fails before hci_register_dev() completes, the HCI_UNREGISTER flag is never set. As a result, when the device reference count reaches zero, bt_host_release() evaluates this flag as false and falls back to a direct kfree(hdev).
Because hci_release_dev() is bypassed, the SRCU struct initialized early in hci_alloc_dev() is never cleaned up, resulting in a leak of percpu memory.
Fix the leak by explicitly calling cleanup_srcu_struct() in the fallback (unregistered) branch of bt_host_release() before freeing the device.
From the CVE record · Linux
Early failures during Bluetooth HCI UART device initialization can leak per-CPU memory because device release skips SRCU cleanup. The input does not specify how an attacker could trigger the failure or whether access or user interaction is required.
Anyone running a Linux kernel with Bluetooth HCI UART support should check whether their kernel includes the fix; affected versions are not specified.