HID: logitech-hidpp: Fix kernel crash on receiver USB disconnect
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c39e3d5fc9dd3e16c6f59dd94d827540040de66d · < fd72ac9556a473fc7daf54efb6ca8a97180d621d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: logitech-hidpp: Fix kernel crash on receiver USB disconnect
hidpp_connect_event() has *four* time-of-check vs time-of-use (TOCTOU) races when it races with itself.
hidpp_connect_event() primarily runs from a workqueue but it also runs on probe() and if a "device-connected" packet is received by the hw when the thread running hidpp_connect_event() from probe() is waiting on the hw, then a second thread running hidpp_connect_event() will be started from the workqueue.
This opens the following races (note the below code is simplified):
1. Retrieving + printing the protocol (harmless race):
if (!hidpp->protocol_major) { hidpp_root_get_protocol_version() hidpp->protocol_major = response.rap.params[0]; }
We can actually see this race hit in the dmesg in the abrt output attached to rhbz#2227968:
From the CVE record · Linux
The Linux kernel’s Logitech HID++ driver has a race in device connection handling that can register two power supplies for the same battery. If the race occurs, disconnecting the USB receiver can trigger a use-after-free and crash the kernel. The described trigger involves local USB device activity; the input does not specify authentication requirements.
Anyone running the Linux kernel with the Logitech HID++ driver should check their kernel version; affected versions are not specified.