Bluetooth: hci_ldisc: Clear HCI_UART_PROTO_INIT on error
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5df5dafc171b90d0b8d51547a82657cd5a1986c7 · < 3daa5818e473ed60eb69d8b5c71b651909d28c5a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_ldisc: Clear HCI_UART_PROTO_INIT on error
When hci_register_dev() fails in hci_uart_register_dev() HCI_UART_PROTO_INIT is not cleared before calling hu->proto->close(hu) and setting hu->hdev to NULL. This means incoming UART data will reach the protocol-specific recv handler in hci_uart_tty_receive() after resources are freed.
Clear HCI_UART_PROTO_INIT with a write lock before calling hu->proto->close() and setting hu->hdev to NULL. The write lock ensures all active readers have completed and no new reader can enter the protocol recv path before resources are freed.
This allows the protocol-specific recv functions to remove the "HCI_UART_REGISTERED" guard without risking a null pointer dereference if hci_register_dev() fails.
From the CVE record · Linux
The Linux kernel Bluetooth HCI UART line discipline can leave a protocol receive path active after device registration fails and its resources are freed. Incoming UART data can then reach that path, risking a null pointer dereference. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with Bluetooth HCI UART support should check their versions; affected versions are not specified.