Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F9C31A6834 for ; Fri, 1 May 2026 14:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777645176; cv=none; b=pyBQlQw0phZ+LHC+wDc+m9XhOReQu/lCJeResOTSR9jjDhYYUUmVfQQk8OvXitLQJ2tC+XUZZQmC/Y07lYaaQ8LSeXLdZ7CRe4aaKsIOP3K5F5cuLNx0yDF7G1PFjrlhVulHDYRvxlcvhdouB9jWJik/i6JVnLkfdmTjpZbwkec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777645176; c=relaxed/simple; bh=xltiAq6KnNTwyP8TKciO9G31pNF2NGa0HNgtYkJQZSo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lhdsRI0jGHjYzRWU2pITjveLFyKLbswNHqIKQ65AC/9aQBGDYhQvYZc1k538y+4iwmoZdHAfmHgnCatxtlLbhSGl/75GRA32n2mHAz6BoKYmw38432UAjCUBpAe0HdoTlMgANRBxJwm4UQ0oqSSmY8biyEwNuoGTwxJcTowpT0M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kkzGXkZa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kkzGXkZa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED7C0C2BCB4; Fri, 1 May 2026 14:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777645176; bh=xltiAq6KnNTwyP8TKciO9G31pNF2NGa0HNgtYkJQZSo=; h=From:To:Cc:Subject:Date:Reply-To:From; b=kkzGXkZaDT9OigF1R0DEJ4sMcT78NonUq4kFSeN0mq8frdf6OpKOvHaNvuJ5pmbLw 4QJT0QqR4dND5THfNpthH+n08RpBcyloBdTDD7qoRwAqHtNwux37zJKU/dHabFdlYQ SgPzHJC/h/6YMposnIxDIf12ecMHn+C3pO+pLbBI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31756: usb: dwc2: gadget: Fix spin_lock/unlock mismatch in dwc2_hsotg_udc_stop() Date: Fri, 1 May 2026 16:15:07 +0200 Message-ID: <2026050144-CVE-2026-31756-87ec@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3738; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QjVFUjLfsgTf592FJRvIN+zS9crI7LcaXgLO6cyBT2I=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlftobk3q1xmXds0qdrPyOWzuRSnfHlrXd5b2vMr9tJ7 6tubtc81RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATec7BMD/cKyTw5i6R0idT GA593L6h0Wnp6SsMC5oi70m3sXwQ5d4tvkfaOLP4jNoldQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman 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. The Linux kernel CVE team has assigned CVE-2026-31756 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15.187 with commit 5cb3cb3db317c58d50b68f3ca3bb8343ea9d1acd and fixed in 5.15.203 with commit e9fcca3e87463013d595c65c2189ffaa32ad3b50 Issue introduced in 6.1.143 with commit 1ac826cebc2776f91569f2aa9c9c3da2375d2096 and fixed in 6.1.168 with commit 8ffe31acb3b77a30ae34d01719a269881569fb7f Issue introduced in 6.6.96 with commit 41732f9febdccb4f9b87c13cb915d717d68ccafd and fixed in 6.6.134 with commit beab10429439e20708036a66fb0d97ffb79da6a1 Issue introduced in 6.12.36 with commit ba78c2b3254c4a458c01776612e8a573e12f8d26 and fixed in 6.12.81 with commit 4ed9d2dd9f29828c311db6ec4b8e0d34bfd6d6a4 Issue introduced in 6.16 with commit af076a41f8a28faf9ceb9dd2d88aef2c202ef39a and fixed in 6.18.22 with commit 61937f686290494998236c680ce0836b8dd63a3f Issue introduced in 6.16 with commit af076a41f8a28faf9ceb9dd2d88aef2c202ef39a and fixed in 6.19.12 with commit 51b62286fc668c6eb74dee7624ec0beec3c5a0ed Issue introduced in 6.16 with commit af076a41f8a28faf9ceb9dd2d88aef2c202ef39a and fixed in 7.0 with commit 9bb4b5ed7f8c4f95cc556bdf042b0ba2fa13557a Issue introduced in 6.15.5 with commit b39c203690fa1678daecc60f347e43c8b593b969 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31756 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/usb/dwc2/gadget.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/e9fcca3e87463013d595c65c2189ffaa32ad3b50 https://git.kernel.org/stable/c/8ffe31acb3b77a30ae34d01719a269881569fb7f https://git.kernel.org/stable/c/beab10429439e20708036a66fb0d97ffb79da6a1 https://git.kernel.org/stable/c/4ed9d2dd9f29828c311db6ec4b8e0d34bfd6d6a4 https://git.kernel.org/stable/c/61937f686290494998236c680ce0836b8dd63a3f https://git.kernel.org/stable/c/51b62286fc668c6eb74dee7624ec0beec3c5a0ed https://git.kernel.org/stable/c/9bb4b5ed7f8c4f95cc556bdf042b0ba2fa13557a