mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map
[ Upstream commit 990262fdfce24d6055df9711424343d94d829e6a ] 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
7d49558be0
commit
6782a62c32
@@ -36,6 +36,12 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
|
||||
unsigned int size;
|
||||
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