CVE-2026-89624: HID: universal-pidff: stop the device when force-feedback init fails
In the Linux kernel, the following vulnerability has been resolved:
HID: universal-pidff: stop the device when force-feedback init fails
universalpidffprobe() starts the device with hidhwstart() and then, if force-feedback initialisation fails, returns the error through a label that only does "return error". The device is left started.
The HID core does not unwind on the driver's behalf. hiddeviceprobe() releases the devres group, closes the report and clears hdev->driver:
if (ret) { devresreleasegroup(&hdev->dev, hdev->devresgroupid); hidclosereport(hdev); hdev->driver = NULL; }
The hidraw character device that hidhwstart() registered through hidconnect() is allocated with kzalloc() and added with cdevdeviceadd(), so it is not devres-managed and survives that. With hdev->driver NULL, hiddeviceremove() skips hidhwstop() as well, because it only unwinds while a driver is still attached. The registration therefore outlives the device on both paths.
Opening the surviving /dev/hidrawX writes into freed memory. KASAN reports a use-after-free write from hidrawopen() -> hidhwopen() -> the transport's open callback, which takes a spinlock inside the freed object. A descriptor that carries a PID usage page and no input reports is enough: hidraw claims the device so hidhwstart() succeeds, while hid->inputs stays empty so force-feedback init fails. The other failure returns in hidpidffinitwithquirks() - no output reports, an allocation failure, pidffinitfields(), pidffcheckautocenter(), an unusable effect count, inputffcreate() - all reach the same label.
Stop the device on that path. hid-dr.c and hid-emsff.c, which start the device with the same HIDCONNECTDEFAULT & ~HIDCONNECTFF mask, already do this. The two earlier gotos must keep returning without hidhwstop(), since neither has a started device, so give the path that fails after the start its own label.
Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Exposure requires a HID device using the universal-pidff driver where force-feedback initialization fails after hid_hw_start() has started the device. In that state, the hidraw character device can remain registered after the underlying HID device has been released.
What is required to trigger the use-after-free?
A surviving /dev/hidrawX device must be opened after the failed probe and device cleanup sequence. The open path reaches hidraw_open(), then hid_hw_open() and the transport open callback, which can write through freed memory.
How can the issue be identified during testing?
KASAN can report a use-after-free write originating from hidraw_open() through hid_hw_open() to the transport's open callback. The affected condition also leaves hdev->driver cleared while the hidraw registration survives.