CVE-2026-142804: driver core: take parent lock in async device attach
In the Linux kernel, the following vulnerability has been resolved:
driver core: take parent lock in async device attach
For device types with needparentlock set (only USB interfaces), probe() must run with the parent device locked. A synchronous attach after deviceadd() gets this from the caller, e.g. usbsetconfiguration() holds the udev lock while adding interfaces. deviceattachasynchelper() runs the probe from an async worker instead, where that lock isn't held, and only takes devicelock(dev).
With async probing enabled for the hub driver (e.g. driverasyncprobe= or driverasyncprobe=hub), this races when a multi-TT hub is configured. For multi-TT hubs, hubprobe() calls usbsetinterface(hdev, 0, 1) to select the TT-per-port altsetting, and usbsetinterface() creates the endpoint devices of the interface a second time:
usbsetconfiguration() async worker [udev locked] deviceadd(intf) queues the probe ----------> deviceattachasynchelper() [intf locked, udev not locked] hubprobe() usbsetinterface(hdev, 0, 1) createintfepdevs(intf) createintfepdevs(intf)
createintfepdevs() checks and sets intf->epdevscreated without a lock of its own. If usbsetconfiguration() has created ep81 but not yet set the flag, usbsetinterface() skips removing the endpoint devices of the old altsetting and creates ep81 again. With a synchronous probe, hubprobe() runs inside deviceadd() with the udev lock held, and usbsetconfiguration() then finds epdevscreated already set.
Single-TT hubs don't call usbsetinterface() from hubprobe() and don't show this warning, but their probe runs without the udev lock as well.
On an i.MX8MM board with an onboard USB2514 hub this hit 11 of 100 boots:
sysfs: cannot create duplicate filename '.../1-1/1-1:1.0/ep81' Call trace: sysfswarndup usbcreateepdevs createintfepdevs usbsetinterface hubprobe usbprobeinterface reallyprobe deviceattachasynchelper asyncrunentryfn
It also shows on v7.3-rc6 in QEMU, with dummyhcd and a raw-gadget program emulating a multi-TT hub: re-authorizing the hub in a loop, while a SCHEDFIFO task preempts the writing task at random points for 3 ms, hit the warning in 29 of 6000 iterations.
Take the parent lock in deviceattachasynchelper() as well, like driverattachasynchelper() does, and move devicedriverlock/unlock() up for that. With this the warning was gone in 300 boots on the board and in 6000 iterations in QEMU.
[ johan: switch to asyncscheduledevnocall() to avoid deadlock if asyncscheduledev() runs synchronously when parent lock is held ] [ Fold the nested conditions into a single if statement; correct commit message to mention "device types" rather than "buses" for "needparentlock". - Danilo ]
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this race?
Systems are exposed when asynchronous probing is enabled for the USB hub driver, such as with driver_async_probe=* or driver_async_probe=hub, and a multi-TT USB hub is configured.
What configuration should be avoided until the fix is applied?
Avoid enabling asynchronous probing for the hub driver. The affected path depends on the hub probe running from an asynchronous worker without the USB parent device lock.
How can I assess whether the vulnerable path is relevant on a system?
Check whether the kernel is configured to asynchronously probe the hub driver and whether multi-TT USB hubs are in use. Both conditions are described as necessary for the race.