KernelScan.io

HIGH Introduced in 4.14

usb-gadget CallbackUsage Race

CVE-2026-98765

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: USB: gadget: dummy-hcd: Fix wait for outstanding request completions The dummy-hcd driver emulates synchronize_irq() by waiting until its private callback_usage counter drops to 0 (with the private lock not held). This counter is incremented whenever a gadget driver callback occurs (which requires the private lock to be dropped), but not when a request completion handler is called. This is an oversight. Request completion is triggered by timer interrupts (emulating device IRQs in a real UDC), and the interrupt handlers are supposed to have completed when the synchronize_irq() emulation routine returns -- they aren't supposed to be in the middle of a completion callback. If this happens it can lead to a gadget driver's unbind routine running before all outstanding request completions have finished, maybe even allowing the gadget driver's module to be unloaded while a completion handler is still running. Fix the oversight by incrementing the callback_usage value across request completion callbacks.

02

Engine v0.9.0

Risk summary

A local attacker with access to the USB gadget subsystem can trigger a race condition in the dummy-hcd virtual UDC driver, causing a gadget driver module to be unloaded while a request completion callback is still executing. This use-after-free can lead to kernel memory corruption, privilege escalation, or system crash. The vulnerability affects systems using the dummy-hcd driver for USB gadget testing or emulation.

Affecteddrivers/usb/gadget/udc/dummy_hcd.c (USB gadget dummy-hcd driver)

Vulnerability analysis

The dummy-hcd driver emulates hardware interrupt synchronization by tracking in-flight callbacks with a callback_usage counter. The counter was incremented for gadget driver callbacks but omitted for request completion handlers, which are invoked from timer interrupts emulating device IRQs. This allows the driver's stop routine to proceed with cleanup — including unbinding the gadget driver and potentially unloading its module — while a completion callback is still running, creating a use-after-free on the module's code and data. The fix adds the missing counter increments around both the regular giveback path and the immediate FIFO completion path, ensuring all callbacks are accounted for before synchronization completes. Exploitation requires local access to the USB gadget subsystem (typically root or CAP_SYS_ADMIN, or a container with device access) and winning a tight race window between the unbind path and the timer-driven completion.

03

BranchIntroducedFixed inPatch commit
3.163.16.523.1748ef54100cef
3.23.2.973.332721319e89a
4.14.1.464.2d77cc7c0d739
4.134.13.64.145298c96bf006
4.44.4.924.56849e51b89de
4.94.9.554.107ce4dca0d53b
5.104.145.10.2733070806a7bc7
5.154.145.15.224b263ff9b0fc5
6.14.146.1.191—
6.124.146.12.113—
6.184.146.18.56—
6.64.146.6.160—
7.24.147.2.10—
mainline4.147.3—
cip/6.124.146.12.114-cip347ce4dca0d53b

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.114-cip34
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.272-cip79)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.272-cip79-rt35)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)