Skip to contentSkip to conversation

CVE-2022-50132: usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_gadget_ep_enable()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 18, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_gadget_ep_enable()

If 'ep' is NULL, result of ep_to_cdns3_ep(ep) is invalid pointer and its dereference with priv_ep->cdns3_dev may cause panic.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

The Linux kernel CVE team has assigned CVE-2022-50132 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.4 with commit 7733f6c32e36ff9d7adadf40001039bf219b1cbe and fixed in 5.10.137 with commit 7af83bb516d7aa4f96835288e4aeda21d7aa2a17
	Issue introduced in 5.4 with commit 7733f6c32e36ff9d7adadf40001039bf219b1cbe and fixed in 5.15.61 with commit bfa0201468587072454dba7933e4a4a7be44467a
	Issue introduced in 5.4 with commit 7733f6c32e36ff9d7adadf40001039bf219b1cbe and fixed in 5.18.18 with commit d342203df9f2d0851b4acd9ed577d73d10eade77
	Issue introduced in 5.4 with commit 7733f6c32e36ff9d7adadf40001039bf219b1cbe and fixed in 5.19.2 with commit eb82c0382285ee17a9966aaab27b8becb08eb1ac
	Issue introduced in 5.4 with commit 7733f6c32e36ff9d7adadf40001039bf219b1cbe and fixed in 6.0 with commit c3ffc9c4ca44bfe9562166793d133e1fb0630ea6

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-2022-50132

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/cdns3/cdns3-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/7af83bb516d7aa4f96835288e4aeda21d7aa2a17
	https://git.kernel.org/stable/c/bfa0201468587072454dba7933e4a4a7be44467a
	https://git.kernel.org/stable/c/d342203df9f2d0851b4acd9ed577d73d10eade77
	https://git.kernel.org/stable/c/eb82c0382285ee17a9966aaab27b8becb08eb1ac
	https://git.kernel.org/stable/c/c3ffc9c4ca44bfe9562166793d133e1fb0630ea6