mirror-linux/drivers/usb/gadget/udc
Greg Kroah-Hartman f880aac8a5 usb: gadget: renesas_usb3: validate endpoint index in standard request handlers
The GET_STATUS and SET/CLEAR_FEATURE handlers extract the endpoint
number from the host-supplied wIndex without any sort of validation.
Fix this up by validating the number of endpoints actually match up with
the number the device has before attempting to dereference a pointer
based on this math.

This is just like what was done in commit ee0d382feb ("usb: gadget:
aspeed_udc: validate endpoint index for ast udc") for the aspeed driver.

Fixes: 746bfe63bb ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: stable <stable@kernel.org>
Assisted-by: gregkh_clanker_t1000
Link: https://patch.msgid.link/2026040647-sincerity-untidy-b104@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-04-07 13:48:30 +02:00
..
aspeed-vhub Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bdc usb: gadget: bdc: validate status-report endpoint indices 2026-03-30 16:47:45 +02:00
cdns2 treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
Kconfig usb: Remove orphaned UDC drivers 2025-04-11 16:11:25 +02:00
Makefile usb: Remove orphaned UDC drivers 2025-04-11 16:11:25 +02:00
amd5536udc.h
amd5536udc_pci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
aspeed_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
at91_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
at91_udc.h
atmel_usba_udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
atmel_usba_udc.h
bcm63xx_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
core.c usb: gadget: udc: update outdated comment for renamed usb_gadget_udc_start() 2026-03-30 16:50:09 +02:00
dummy_hcd.c usb: gadget: dummy_hcd: fix premature URB completion when ZLP follows partial transfer 2026-03-18 16:19:33 +01:00
fsl_qe_udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_qe_udc.h
fsl_udc_core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_usb2_udc.h
goku_udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
goku_udc.h
gr_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
gr_udc.h
lpc32xx_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
m66592-udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
m66592-udc.h
max3420_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
net2280.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
net2280.h
omap_udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
omap_udc.h
pch_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pxa25x_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pxa25x_udc.h
pxa27x_udc.c USB: pxa27x_udc: check return value of clk_enable 2026-03-18 16:03:34 +01:00
pxa27x_udc.h
r8a66597-udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
r8a66597-udc.h
renesas_usb3.c usb: gadget: renesas_usb3: validate endpoint index in standard request handlers 2026-04-07 13:48:30 +02:00
renesas_usbf.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
rzv2m_usb3drd.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
snps_udc_core.c usb: gadget: udc: Use safer strscpy() instead of strcpy() 2026-03-11 15:39:04 +01:00
snps_udc_plat.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
tegra-xudc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
trace.c
trace.h usb: udc: Add trace event for usb_gadget_set_state 2025-09-12 14:03:14 +02:00
udc-xilinx.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00