Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map

Do not process unknown data types.

Tested-by: Yunke Cao <yunkec@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20250203-uvc-roi-v17-15-5900a9fed613@chromium.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
990262fd dc6d7e05

+6
+6
drivers/media/usb/uvc/uvc_v4l2.c
··· 108 108 struct uvc_control_mapping *map; 109 109 int ret; 110 110 111 + if (xmap->data_type > UVC_CTRL_DATA_TYPE_BITMASK) { 112 + uvc_dbg(chain->dev, CONTROL, 113 + "Unsupported UVC data type %u\n", xmap->data_type); 114 + return -EINVAL; 115 + } 116 + 111 117 map = kzalloc(sizeof(*map), GFP_KERNEL); 112 118 if (map == NULL) 113 119 return -ENOMEM;