HIGH
usb dummy-hcd Interrupt Race
CVE-2026-43324
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI5.2MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: USB: dummy-hcd: Fix interrupt synchronization error This fixes an error in synchronization in the dummy-hcd driver. The error has a somewhat involved history. The synchronization mechanism was introduced by commit 7dbd8f4cabd9 ("USB: dummy-hcd: Fix erroneous synchronization change"), which added an emulated "interrupts enabled" flag together with code emulating synchronize_irq() (it waits until all current handler callbacks have returned). But the emulated interrupt-disable occurred too late, after the driver containing the handler callback routines had been told that it was unbound and no more callbacks would occur. Commit 4a5d797a9f9c ("usb: gadget: dummy_hcd: fix gpf in gadget_setup") tried to fix this by moving the synchronize_irq() emulation code from dummy_stop() to dummy_pullup(), which runs before the unbind callback. There still were races, though, because the emulated interrupt-disable still occurred too late. It couldn't be moved to dummy_pullup(), because that routine can be called for reasons other than an impending unbind. Therefore commits 7dc0c55e9f30 ("USB: UDC core: Add udc_async_callbacks gadget op") and 04145a03db9d ("USB: UDC: Implement udc_async_callbacks in dummy-hcd") added an API allowing the UDC core to tell dummy-hcd exactly when emulated interrupts and their callbacks should be disabled. That brings us to the current state of things, which is still wrong because the emulated synchronize_irq() occurs before the emulated interrupt-disable! That's no good, beause it means that more emulated interrupts can occur after the synchronize_irq() emulation has run, leading to the possibility that a callback handler may be running when the gadget driver is unbound. To fix this, we have to move the synchronize_irq() emulation code yet again, to the dummy_udc_async_callbacks() routine, which takes care of enabling and disabling emulated interrupt requests. The synchronization will now run immediately after emulated interrupts are disabled, which is where it belongs.
02KernelScan AI Analysis
Risk summary
A race condition in the dummy-hcd USB gadget driver can cause callback handlers to execute after the gadget driver is unbound, resulting in a use-after-free. This can lead to kernel crashes (general protection fault) and potentially limited information disclosure or memory corruption. The vulnerability is reachable only when the dummy-hcd driver is in use and a privileged user triggers gadget unbinding.
Vulnerability analysis
The vulnerability stems from incorrect ordering of interrupt synchronization in the dummy-hcd driver. The emulated synchronize_irq() was performed before emulated interrupts were disabled, creating a window where new interrupt callbacks could be scheduled after synchronization completed but before the gadget driver was unbound. Because the gadget driver may be freed during unbind, any callback that fires in this window operates on freed memory — a use-after-free. The fix moves the synchronization code into dummy_udc_async_callbacks() so that it runs immediately after interrupts are disabled, eliminating the race window.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.15 | 5.15.203 | d847f375b1bc |
| 6.1 | 6.1.168 | cbf7df5e5d27 |
| 6.12 | 6.12.81 | 94d4fab1dd9e |
| 6.18 | 6.18.22 | 5687a0977606 |
| 6.19 | 6.19.12 | 8bcd80219d8e |
| 6.6 | 6.6.134 | 5aa776c8615b |
| mainline | 7.0 | 2ca9e46f8f1f |