HIGH Introduced in 4.18
aspeed-vhub WakeWork UAF
CVE-2026-98766
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: aspeed-vhub: cancel wake work on device removal wake_work is armed from the gadget .wakeup callback to resume suspended downstream ports, and it is never cancelled in ast_vhub_remove(), so a work item queued before or during removal can run after devm has freed vhub and its ports, a use-after-free. Cancelling the work alone is not sufficient: usb_gadget_wakeup() takes no lock and the unbind path never clears wakeup_en, so a remote-wakeup request in flight on another CPU can re-arm the work after the cancel and before vhub is freed. ast_vhub_del_dev() already clears d->registered under vhub->lock before unregistering the gadget. Refuse the wakeup in ast_vhub_udc_wakeup() once d->registered is clear: the check and the schedule_work() are then atomic against the unbind, so a wakeup that passed before the flag was cleared is drained by the cancel_work_sync() after the del_dev loop, and one that arrives later returns without arming. Also move INIT_WORK() to the top of ast_vhub_probe(), since the probe error path reuses ast_vhub_remove() and would otherwise cancel a never-initialized work item. This issue was found by an in-house static analysis tool.
02KernelScan AI Analysis
Risk summary
A use-after-free in the Aspeed virtual hub USB gadget driver allows a local attacker on the Aspeed SoC (BMC) to execute arbitrary code or crash the kernel by racing a gadget wakeup request with device removal. The vulnerability is reachable when a gadget function bound to the virtual hub initiates a remote wakeup while the driver is being unbound, such as during module unload or system shutdown.
Vulnerability analysis
The Aspeed virtual hub driver uses a background work task to resume suspended downstream ports when a gadget function requests a remote wakeup. During device removal, this work task was never cancelled, so a wakeup request queued before or during removal could execute after the driver's memory had been freed. Additionally, because the wakeup callback uses no lock and the unbind path did not clear the wakeup-enable flag, a concurrent wakeup on another CPU could re-arm the work after cancellation but before the memory was released. The fix adds a synchronized work cancellation after all ports are unregistered, checks a registration flag under the driver lock to atomically reject new wakeups once teardown begins, and initializes the work task earlier during probe so the error path can safely cancel it.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.18 | 5.10.273 | 89b3fef8809e |
| 5.15 | 4.18 | 5.15.224 | 3aed0c86afa7 |
| 6.1 | 4.18 | 6.1.191 | 552f580a1878 |
| 6.12 | 4.18 | 6.12.113 | f343bfa3fc9f |
| 6.18 | 4.18 | 6.18.56 | 474e9e1852fb |
| 6.6 | 4.18 | 6.6.160 | 0d39ac4f65f9 |
| 7.2 | 4.18 | 7.2.10 | c81504dfd2d9 |
| mainline | 4.18 | 7.3 | 20388c8d1d74 |
| cip/6.12 | 4.18 | 6.12.114-cip34 | f343bfa3fc9f |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |