UPSTREAM: 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> (cherry picked from commit 990262fdfce24d6055df9711424343d94d829e6a) Bug: 381493003 Bug: 408968367 Change-Id: I868b42120a7f12c1a765188eb4657234b6d8b9cf Signed-off-by: Ricardo Ribalda <ribalda@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
4eff0942d4
commit
55072be879
@@ -106,6 +106,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