---
id: "CVE-2026-98757"
kind: "vulnerability"
aliases: ["CVE-2026-98757"]
title: "Linux kernel: cdns3 USB driver use-after-free on gadget exit"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["embedded", "linux-kernel", "runtime", "usb-gadget"]
not_affected_if: ["cdns3-driver-not-loaded", "no-usb-gadget-mode"]
published_at: "2026-10-18T16:17:29+00:00"
first_seen_at: "2026-10-23T21:57:16+00:00"
updated_at: "2026-10-25T05:16:50+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-98757", "first_seen_at": "2026-10-23T21:57:16+00:00"}]
---

# Linux kernel: cdns3 USB driver use-after-free on gadget exit

The Cadence USB3 gadget driver in the Linux kernel can free its device structures while deferred work items still reference them, because the exit path does not wait for those work items to finish. A local or hardware-triggered race on driver teardown can lead to a use-after-free in kernel memory.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the running kernel includes the usb: cdns3 fix by looking at the kernel version with `uname -r` and the distribution's changelog for 'cdns3_gadget_exit'.
- Check whether the cdns3 driver is loaded with `lsmod | grep cdns3` or `lsmod | grep cdns3_`; if absent, the system is not exposed through this driver.

## Fix

- Update the Linux kernel to a release that contains the upstream commit fixing cdns3_gadget_exit(); the fixed version is unknown from the sources.
- Until patched, avoid unbinding or unloading the cdns3 gadget driver on exposed systems (unknown from the sources whether this fully mitigates).

## Timeline

- 2026-10-23T21:57:16+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-98757

## From the sources

In the Linux kernel, the following vulnerability has been resolved:

usb: cdns3: fix use-after-free in cdns3_gadget_exit()

cdns3_gadget_start() arms two works on system_freezable_wq:
pending_status_wq for the deferred ep0 status stage and aligned_buf_wq
for realigned request buffers. Both handlers use the cdns3_device the
works are embedded in, and cdns3_pending_setup_status_handler() also
calls the ep0 request completion.

cdns3_gadget_exit() does not wait for these works. It frees all
endpoints and aligned buffers and drops the last reference to the
gadget device, which frees priv_dev, so a work queued before the exit
can run after the free.

Fix this by waiting for both works after the gadget driver is unbound
and the IRQ is freed, when no new work can be queued, and before the
endpoints and buffers are released.

This issue was found by an in-house static analysis tool.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
