Skip to content

Commit a0d7271

Browse files
author
Desnes Nunes
committed
media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map
JIRA: https://issues.redhat.com/browse/RHEL-78934 commit 990262f Author: Ricardo Ribalda <ribalda@chromium.org> Date: Mon, 3 Feb 2025 11:55:51 +0000 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> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 4ae060a commit a0d7271

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/media/usb/uvc/uvc_v4l2.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ static int uvc_ioctl_xu_ctrl_map(struct uvc_video_chain *chain,
108108
struct uvc_control_mapping *map;
109109
int ret;
110110

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+
111117
map = kzalloc(sizeof(*map), GFP_KERNEL);
112118
if (map == NULL)
113119
return -ENOMEM;

0 commit comments

Comments
 (0)