CVE-2026-142929: USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails
In the Linux kernel, the following vulnerability has been resolved:
USB: usbmon: fix null-ptr-deref in monbusremove() when monbusinit() fails
When monbusinit() fails to allocate the monbus struct, it returns without setting ubus->monbus, so mbus->monbus remains NULL. monbusadd() intentionally ignores this failure because the USB core does not require monitoring to be established for normal operation. However, when the HCD is later removed, usbremovehcd() fires the USBBUSREMOVE notifier which calls monbusremove(), it dereferences ubus->monbus without checking for NULL, causing a null-ptr deference.
Fix this by adding a NULL check for mbus at the top of monbusremove(). If monbusinit() failed, ubus->monbus is NULL, meaning the bus was never tracked by the monitor, so there is nothing to clean up and returning early is correct.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.119 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Compensating control
Add a NULL check for mbus at the top of mon_bus_remove() and return early when it is NULL.
Event History
Frequently Asked Questions
What conditions are required for the crash to occur?
usbmon initialization must first fail to allocate its per-bus mon_bus structure. The affected USB host controller must then be removed, causing the USB_BUS_REMOVE notifier to invoke mon_bus_remove() with ubus->mon_bus still NULL.
Does a failed usbmon setup prevent normal USB operation?
No. mon_bus_add() intentionally ignores usbmon initialization failure because USB core operation does not require monitoring to be established. The failure becomes relevant later if the host controller is removed.
How can I tell whether a system is exposed to this failure path?
The relevant condition is failure to allocate the usbmon mon_bus structure followed by removal of the USB HCD. A null-pointer dereference during host-controller removal after an earlier usbmon allocation failure indicates this path.