Bluetooth: MGMT: free the HCI command when it is cancelled
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 |
|
|
6.18.527.2.67.3In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MGMT: free the HCI command when it is cancelled
mgmt_hci_cmd_sync() queues the pending command with a NULL destroy callback, so it is only freed if send_hci_cmd_sync() runs. A cancelled entry is leaked, as _hci_cmd_sync_cancel_entry() does not release entry->data when there is no destroy callback, and hci_cmd_sync_clear() cancels every pending entry when the controller is unregistered. Nothing else reclaims it either: mgmt_pending_new() does not put the command on hdev->mgmt_pending.
The leak also pins the socket reference taken by mgmt_pending_new(), so the mgmt socket is never released.
Free the command from a destroy callback. The now-empty done label is replaced by a direct return.
From the CVE record · Linux
The Linux kernel Bluetooth MGMT code leaks a pending HCI command when it is cancelled before being sent. The leak also keeps a management socket reference alive; controller unregistration cancels all pending commands. The input does not specify how an attacker could trigger this condition or whether access or user interaction is required.
Engineers running Linux kernels with Bluetooth MGMT support should check their versions; affected versions are not specified.