mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
media: uvcvideo: Fix OOB read
If the index provided by the user is bigger than the mask size, we might do
an out of bound read.
CC: stable@kernel.org
Fixes: 40140eda66
("media: uvcvideo: Implement mask for V4L2_CTRL_TYPE_MENU")
Reported-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
861ab817b5
commit
41ebaa5e0e
@ -1402,6 +1402,9 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
|
||||
query_menu->id = id;
|
||||
query_menu->index = index;
|
||||
|
||||
if (index >= BITS_PER_TYPE(mapping->menu_mask))
|
||||
return -EINVAL;
|
||||
|
||||
ret = mutex_lock_interruptible(&chain->ctrl_mutex);
|
||||
if (ret < 0)
|
||||
return -ERESTARTSYS;
|
||||
|
Loading…
Reference in New Issue
Block a user