Bluetooth: MGMT: free the mesh send cancel command when it is cancelled
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b338d91703fae6f6afd67f3f75caa3b8f36ddef3 · < 3c742feda8fcabf741a17bcf668b63c8f606f9c5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MGMT: free the mesh send cancel command when it is cancelled
mesh_send_cancel() queues the pending command with a NULL destroy callback, so it is only freed if send_cancel() 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.
From the CVE record · Linux
The Linux kernel's Bluetooth MGMT mesh send cancel command can leak memory when a pending command is cancelled, including when a controller is unregistered. The leak also keeps a management socket reference from being released. The input does not specify an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels with Bluetooth MGMT should check their versions against the vendor advisory; affected versions are not specified here.