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

usb: dwc2: gadget: Fix spin_lock/unlock mismatch in dwc2_hsotg_udc_stop()

dwc2_gadget_exit_clock_gating() internally calls call_gadget() macro,
which expects hsotg->lock to be held since it does spin_unlock/spin_lock
around the gadget driver callback invocation.

However, dwc2_hsotg_udc_stop() calls dwc2_gadget_exit_clock_gating()
without holding the lock. This leads to:
- spin_unlock on a lock that is not held (undefined behavior)
- The lock remaining held after dwc2_gadget_exit_clock_gating() returns,
causing a deadlock when spin_lock_irqsave() is called later in the
same function.

Fix this by acquiring hsotg->lock before calling
dwc2_gadget_exit_clock_gating() and releasing it afterwards, which
satisfies the locking requirement of the call_gadget() macro.
Published: 2026-05-01
Score: 7.0 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The Linux kernel's dwc2 gadget subsystem contains a mismatch between spin_lock and spin_unlock in dwc2_hsotg_udc_stop. The function calls dwc2_gadget_exit_clock_gating without holding the required lock, which causes a spin_unlock on a lock that is not held (undefined behavior). The lock remains held after the call, and subsequent attempts to acquire it with spin_lock_irqsave fail, resulting in a deadlock. An attacker could trigger this by interfacing with the USB gadget driver, potentially freezing the system or causing a kernel panic. This flaw could be exploited locally on a system that runs the unpatched kernel and has a USB gadget device that invokes the buggy path. The likely attack vector is inferred to be local via interaction with the USB gadget subsystem.

Affected Systems

All Linux kernel builds that include the dwc2 gadget subsystem and still contain the unfixed version of dwc2_hsotg_udc_stop. No specific release list is provided, so any kernel version that has this code before the fix may be vulnerable.

Risk and Exploitability

The CVSS score is 7.0, indicating a high-impact denial of service. The EPSS score is not available. An attacker would need local or physical access to a USB gadget device to trigger the deadlock; remote exploitation is not implied. The flaw is not listed in CISA KEV, suggesting no confirmed exploits yet, but the potential for system unavailability remains significant.

Generated by OpenCVE AI on May 2, 2026 at 10:26 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the running kernel to a version that contains the spin_lock/unlock fix for dwc2_hsotg_udc_stop.
  • If immediate kernel update is not feasible, disable the USB gadget functionality (e.g., by removing the dwc2 module or setting the corresponding kernel parameter) to prevent entry into the buggy code path.
  • Monitor vendor security advisories for updates and plan to apply the patch when a new kernel release is available.

Generated by OpenCVE AI on May 2, 2026 at 10:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4561-1 linux-6.1 security update
Debian DSA Debian DSA DSA-6243-1 linux security update
History

Sat, 02 May 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-832
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate


Fri, 01 May 2026 14:45:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: usb: dwc2: gadget: Fix spin_lock/unlock mismatch in dwc2_hsotg_udc_stop() dwc2_gadget_exit_clock_gating() internally calls call_gadget() macro, which expects hsotg->lock to be held since it does spin_unlock/spin_lock around the gadget driver callback invocation. However, dwc2_hsotg_udc_stop() calls dwc2_gadget_exit_clock_gating() without holding the lock. This leads to: - spin_unlock on a lock that is not held (undefined behavior) - The lock remaining held after dwc2_gadget_exit_clock_gating() returns, causing a deadlock when spin_lock_irqsave() is called later in the same function. Fix this by acquiring hsotg->lock before calling dwc2_gadget_exit_clock_gating() and releasing it afterwards, which satisfies the locking requirement of the call_gadget() macro.
Title usb: dwc2: gadget: Fix spin_lock/unlock mismatch in dwc2_hsotg_udc_stop()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-01T14:14:47.000Z

Reserved: 2026-03-09T15:48:24.139Z

Link: CVE-2026-31756

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-01T15:16:38.580

Modified: 2026-05-01T15:24:14.893

Link: CVE-2026-31756

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-05-01T00:00:00Z

Links: CVE-2026-31756 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-05-02T10:30:40Z

Weaknesses