CVE-2026-31756

MEDIUM

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

Title source: cna
STIX 2.1

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.

Scores

CVSS v3 5.5
EPSS 0.0001
EPSS Percentile 1.8%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Details

CWE
CWE-667
Status published
Products (24)
Linux/Linux < 6.16
Linux/Linux 1ac826cebc2776f91569f2aa9c9c3da2375d2096 - 8ffe31acb3b77a30ae34d01719a269881569fb7f
Linux/Linux 41732f9febdccb4f9b87c13cb915d717d68ccafd - beab10429439e20708036a66fb0d97ffb79da6a1
Linux/Linux 5.15.187 - 5.15.203
Linux/Linux 5.15.203 - 5.15.*
Linux/Linux 5cb3cb3db317c58d50b68f3ca3bb8343ea9d1acd - e9fcca3e87463013d595c65c2189ffaa32ad3b50
Linux/Linux 6.1.143 - 6.1.168
Linux/Linux 6.1.168 - 6.1.*
Linux/Linux 6.12.36 - 6.12.81
Linux/Linux 6.12.81 - 6.12.*
... and 14 more
Published May 01, 2026
Tracked Since May 01, 2026