media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map
[ Upstream commit 990262fdfc ]
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: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9459abd770
commit
faa24692f7
@@ -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