Subject: CVE-2024-46836: usb: gadget: aspeed_udc: validate endpoint index for ast udc

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

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

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

usb: gadget: aspeed_udc: validate endpoint index for ast udc

We should verify the bound of the array to assure that host
may not manipulate the index to point past endpoint array.

Found by static analysis.

The Linux kernel CVE team has assigned CVE-2024-46836 to this issue.

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

	Fixed in 6.1.110 with commit 31bd4fab49c0
	Fixed in 6.6.51 with commit b2a50ffdd1a0
	Fixed in 6.10.10 with commit 6fe9ca2ca389
	Fixed in 6.11 with commit ee0d382feb44

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-2024-46836
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/gadget/udc/aspeed_udc.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/31bd4fab49c0adc6228848357c1b1df9395858af
	https://git.kernel.org/stable/c/b2a50ffdd1a079869a62198a8d1441355c513c7c
	https://git.kernel.org/stable/c/6fe9ca2ca389114c8da66e534c18273497843e8a
	https://git.kernel.org/stable/c/ee0d382feb44ec0f445e2ad63786cd7f3f6a8199