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>
This commit is contained in:
committed by
Hans Verkuil
parent
dc6d7e050c
commit
990262fdfc
@@ -108,6 +108,12 @@ static int uvc_ioctl_xu_ctrl_map(struct uvc_video_chain *chain,
|
||||
struct uvc_control_mapping *map;
|
||||
int ret;
|
||||
|
||||
if (xmap->data_type > UVC_CTRL_DATA_TYPE_BITMASK) {
|
||||
uvc_dbg(chain->dev, CONTROL,
|
||||
"Unsupported UVC data type %u\n", xmap->data_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
map = kzalloc(sizeof(*map), GFP_KERNEL);
|
||||
if (map == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user