Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98757 Overview
CVE-2026-98757 is a use-after-free vulnerability in the Linux kernel's Cadence USB3 (cdns3) gadget driver. The flaw resides in cdns3_gadget_exit(), which releases the priv_dev structure without waiting for two deferred work items queued on system_freezable_wq. Those work items, pending_status_wq and aligned_buf_wq, dereference the freed cdns3_device structure after teardown. An in-house static analysis tool identified the issue, and upstream maintainers have merged fixes across multiple stable branches.
Critical Impact
A race between gadget teardown and queued work handlers can trigger kernel memory corruption, leading to crashes or potential local privilege escalation on systems using the Cadence USB3 controller.
Affected Products
- Linux kernel versions containing the drivers/usb/cdns3 gadget driver prior to the fix commits
- Stable kernel branches patched via commits 159dada4, 95160fe6, cc448700, ebe9b68c, and efdf0dda
- Embedded and SoC platforms that integrate the Cadence USB3 device controller IP
Discovery Timeline
- 2026-10-18 - CVE-2026-98757 published to NVD
- 2026-10-21 - Last updated in NVD database
Technical Details for CVE-2026-98757
Vulnerability Analysis
The Cadence USB3 gadget driver arms two deferred work items during cdns3_gadget_start(). The pending_status_wq work handles the deferred endpoint 0 status stage, and aligned_buf_wq releases realigned request buffers. Both handlers access fields embedded in the cdns3_device structure, and cdns3_pending_setup_status_handler() additionally completes the ep0 request.
When the gadget is torn down, cdns3_gadget_exit() frees all endpoints and aligned buffers, then drops the final reference to the gadget device. Dropping that reference frees the priv_dev allocation. Because the exit path never synchronizes against the two work items, any handler queued prior to teardown can run after the memory has been released.
The fix synchronizes against both work items after the gadget driver is unbound and the IRQ is freed, ensuring no new work can be queued, and before endpoints and buffers are released.
Root Cause
The root cause is a missing synchronization point between work item lifetimes and the gadget teardown sequence. The driver treats the cdns3_device allocation as live for the duration of cdns3_gadget_exit() without calling cancel_work_sync() or an equivalent flush on the queued handlers. This is a classic use-after-free pattern tied to deferred execution contexts.
Attack Vector
Triggering the condition requires the ability to unbind or reconfigure the USB gadget driver while the controller still has pending ep0 status work or aligned buffer work queued. On systems that expose USB gadget configuration through configfs or that reconfigure USB roles dynamically, a local user with sufficient privileges to initiate role swaps or driver unbind operations can race the handlers against teardown. Successful exploitation corrupts kernel heap memory, enabling denial of service or, with careful heap manipulation, arbitrary kernel code execution.
No public proof-of-concept exploit has been published. The vulnerability was identified through static analysis rather than active exploitation. Technical details are documented in the upstream patch commits referenced below.
Detection Methods for CVE-2026-98757
Indicators of Compromise
- Kernel panics or oops messages originating from cdns3_pending_setup_status_handler or cdns3_wa2_resume_work_handler after USB gadget teardown
- KASAN reports flagging use-after-free reads or writes inside drivers/usb/cdns3/gadget.c
- Unexpected USB controller resets following driver unbind operations on Cadence USB3 hardware
Detection Strategies
- Enable CONFIG_KASAN on test and development kernels to surface the use-after-free during QA cycles
- Audit kernel logs for stack traces that reference system_freezable_wq work items tied to cdns3
- Track unprivileged configfs writes to USB gadget bindings and correlate them with subsequent kernel crashes
Monitoring Recommendations
- Centralize kernel ring buffer collection from embedded and edge Linux systems that use Cadence USB3 controllers
- Monitor for repeated gadget driver bind and unbind cycles originating from a single process, which may indicate race condition probing
- Alert on crash dumps that reference cdns3_gadget_exit in the fault backtrace
How to Mitigate CVE-2026-98757
Immediate Actions Required
- Inventory all Linux systems running the cdns3 USB gadget driver, particularly embedded devices and SoC platforms
- Apply the upstream stable kernel update that includes the synchronization fix as soon as vendor builds are available
- Restrict access to USB gadget configuration interfaces such as /sys/kernel/config/usb_gadget/ to privileged administrators only
Patch Information
The fix has been merged into multiple stable branches. Review and apply the appropriate commit for your kernel version: Kernel Patch 159dada4, Kernel Patch 95160fe6, Kernel Patch cc448700, Kernel Patch ebe9b68c, and Kernel Patch efdf0dda. Each patch adds work item synchronization inside cdns3_gadget_exit().
Workarounds
- Unload the cdns3 module on systems that do not require USB gadget functionality
- Avoid dynamic USB role swaps and gadget driver rebinds on production hardware until the patch is applied
- Restrict CAP_SYS_ADMIN and configfs mount permissions to limit the local attack surface
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

