CVE-2026-31578: media: as102: fix to not free memory after the device is registered in as102_usb_probe()
In the Linux kernel, the following vulnerability has been resolved:
media: as102: fix to not free memory after the device is registered in as102usbprobe()
In as102usb driver, the following race condition occurs: CPU0 CPU1 as102usbprobe() kzalloc(); // alloc as102devt .... usbregisterdev(); fd = sysopen("/path/to/dev"); // open as102 fd .... usbderegisterdev(); .... kfree(); // free as102devt .... sysclose(fd); as102release() // UAF!! as102usbrelease() kfree(); // DFB!!
When a USB character device registered with usbregisterdev() is later unregistered (via usbderegisterdev() or disconnect), the device node is removed so new open() calls fail. However, file descriptors that are already open do not go away immediately: they remain valid until the last reference is dropped and the driver's .release() is invoked.
In as102, as102usbprobe() calls usbregisterdev() and then, on an error path, does usbderegisterdev() and frees as102devt right away. If userspace raced a successful open() before the deregistration, that open FD will later hit as102release() --> as102usbrelease() and access or free as102devt again, occur a race to use-after-free and double-free vuln.
The fix is to never kfree(as102devt) directly once usbregisterdev() has succeeded. After deregistration, defer freeing memory to .release().
In other words, let release() perform the last kfree when the final open FD is closed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.6.137.1-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31578?
CVE-2026-31578 is considered to have a moderate severity level due to the potential for memory corruption.
How do I fix CVE-2026-31578?
To fix CVE-2026-31578, update the Linux kernel to a version that includes the patch addressing this vulnerability.
What systems are affected by CVE-2026-31578?
CVE-2026-31578 affects Linux kernel versions 6.6.136 and earlier, specifically within the as102 USB driver.
What is the impact of CVE-2026-31578?
The impact of CVE-2026-31578 includes potential system instability or crashes due to race conditions linked to the as102_usb_probe function.
Who does CVE-2026-31578 affect?
CVE-2026-31578 primarily affects users and systems utilizing the as102 USB driver within specific Linux kernel versions.