Bluetooth: btusb: Fix UAF of btusb_data by rx_work
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 800fe5ec302e1ebbf5e3f891f886deecd49c7132 · < 1c12c3117639e78940959d956519c758c57d0849| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: btusb: Fix UAF of btusb_data by rx_work
btusb_close() and btusb_flush() cancel data->rx_work with the asynchronous cancel_delayed_work(), so if btusb_rx_work() is already running on another CPU it keeps running after the cancel returns.
btusb_disconnect() calls hci_unregister_dev(), which invokes btusb_close(), and then frees the btusb_data. A still running btusb_rx_work() then dereferences the freed data:
while ((skb = skb_dequeue(&data->acl_q))) data->recv_acl(data->hdev, skb);
Use cancel_delayed_work_sync() instead. In btusb_close() the cancel also has to happen after btusb_stop_traffic(), otherwise an URB completion racing with the cancel can requeue the work right after it has been waited for.
From the CVE record · Linux
The Linux kernel’s Bluetooth btusb driver can free btusb_data while receive work is still running. That work can then access freed memory during device disconnect; the input does not specify attacker access, authentication requirements, or user interaction.
Engineers running Linux kernels with the Bluetooth btusb driver should check their kernel versions; affected versions are not specified.