Bluetooth: hci_sync: free the advertising instance on the failure and cancel paths
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c249ea9b4309cf3250c5bbb42a05d38d0ed9071c · < 120d8dc042e3d45073bb6e50ee7b058a0b182627| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_sync: free the advertising instance on the failure and cancel paths
adv_timeout_expire() hands a kmalloc()ed instance byte to hci_cmd_sync_queue() with a NULL destroy callback, and only adv_timeout_expire_sync() frees it. That leaks on two paths:
- the return value is not checked, and hci_cmd_sync_queue() does not take ownership when it fails (-ENETDOWN, -ENODEV, -ENOMEM);
- a cancelled entry is not released, as _hci_cmd_sync_cancel_entry() does not free entry->data when there is no destroy callback. hci_cmd_sync_clear() cancels every pending entry when the controller is unregistered.
Free the buffer from a destroy callback, and in the caller when the entry could not be queued at all.
From the CVE record · Linux
The Linux kernel Bluetooth hci_sync code can leak an allocated advertising-instance buffer if a command fails to queue or a pending command is cancelled when the controller is unregistered. The input does not establish whether an attacker can trigger these conditions or whether authentication or user interaction is required.
Engineers running Linux kernels with the affected Bluetooth hci_sync code should check their vendor's advisory; affected versions are not specified.