linux/drivers/usb
Muhammad Bilal b70dc75e85 usb: gadget: uvc: clamp SEND_RESPONSE length to the response buffer
uvc_send_response() builds the UVC control response from a user-supplied
struct uvc_request_data:

	req->length = min_t(unsigned int, uvc->event_length, data->length);
	...
	memcpy(req->buf, data->data, req->length);

req->length is clamped to uvc->event_length, which is taken from the
host control request wLength (up to UVC_MAX_REQUEST_SIZE, 64), and to
data->length, which comes from the UVCIOC_SEND_RESPONSE ioctl and is
only checked for being negative.  The source buffer data->data is only
60 bytes, so a response with uvc->event_length and data->length both
greater than 60 makes memcpy() read past the end of data->data.

Clamp req->length to sizeof(data->data) as well.

Fixes: a5eaaa1f33 ("usb: gadget: uvc: use capped length value")
Cc: stable <stable@kernel.org>
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Link: https://patch.msgid.link/20260629195004.148405-1-meatuni001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-07-13 07:10:11 +02:00
..
atm usb: atm: ueagle-atm: wait for pre-firmware load in .disconnect() 2026-06-25 16:03:39 +01:00
c67x00 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cdns3 usb: cdnsp: fix stream context array leak in cdnsp_alloc_stream_info() 2026-06-25 15:12:15 +01:00
chipidea Linux 7.1-rc6 2026-06-01 17:39:51 +02:00
class usb: cdc_acm: Add quirk for Uniden BC125AT scanner 2026-06-25 15:10:09 +01:00
common USB: ulpi: fix memory leak on registration failure 2026-06-25 15:11:27 +01:00
core USB: core: ratelimit cabling message 2026-07-08 17:19:17 +02:00
dwc2 usb: dwc2: Add include defining struct pci_device_id 2026-07-03 07:38:15 +02:00
dwc3 usb: dwc3: run gadget disconnect from sleepable suspend context 2026-07-08 13:35:22 +02:00
early usb: early: xhci-dbc: Fix early_ioremap leak 2025-07-07 11:04:46 +02:00
fotg210 usb: free iso schedules on failed submit 2026-07-08 13:30:38 +02:00
gadget usb: gadget: uvc: clamp SEND_RESPONSE length to the response buffer 2026-07-13 07:10:11 +02:00
host usb: xhci: Fix sleep in atomic context in xhci_free_streams() 2026-07-08 13:38:28 +02:00
image Merge 7.0-rc4 into usb-next 2026-03-16 11:50:48 +01:00
isp1760 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
misc USB fixes for 7.2-rc3 2026-07-12 12:12:41 -07:00
mon Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
mtu3 usb: mtu3: unmap request DMA on queue failure 2026-06-25 16:04:26 +01:00
musb usb: musb: omap2430: Fix use-after-free in omap2430_probe() 2026-05-22 10:33:43 +02:00
phy usb: phy: isp1301: Use named initializers for struct i2c_device_id 2026-05-21 16:52:36 +02:00
renesas_usbhs usb: renesas_usbhs: use kzalloc_flex 2026-03-18 15:51:48 +01:00
roles usb: roles: get usb role switch from parent only for usb-b-connector 2026-03-11 16:22:22 +01:00
serial USB: serial: keyspan_pda: fix information leak 2026-06-30 10:36:06 +02:00
storage USB: usb-storage: ene_ub6250: restore media-ready check 2026-07-08 13:30:11 +02:00
typec USB fixes for 7.2-rc3 2026-07-12 12:12:41 -07:00
usbip usbip: vudc: fix NULL deref in vep_dequeue() 2026-07-08 13:29:31 +02:00
Kconfig usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
Makefile usb: cdns3: Add USBSSP platform driver support 2026-04-27 05:14:18 -06:00
usb-skeleton.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00