patch "media: uvcvideo: Handle cameras with invalid descriptors" added to usb-next

0 views
Skip to first unread message

gre...@linuxfoundation.org

unread,
Jan 31, 2023, 3:40:03 AM1/31/23
to rib...@chromium.org, laurent....@ideasonboard.com, syzk...@googlegroups.com

This is a note to let you know that I've just added the patch titled

media: uvcvideo: Handle cameras with invalid descriptors

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-next branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release
during the merge window.

If you have any questions about this process, please let me know.


From 41ddb251c68ac75c101d3a50a68c4629c9055e4c Mon Sep 17 00:00:00 2001
From: Ricardo Ribalda <rib...@chromium.org>
Date: Tue, 20 Sep 2022 16:04:55 +0200
Subject: media: uvcvideo: Handle cameras with invalid descriptors

If the source entity does not contain any pads, do not create a link.

Reported-by: syzbot <syzk...@googlegroups.com>
Signed-off-by: Ricardo Ribalda <rib...@chromium.org>
Reviewed-by: Laurent Pinchart <laurent....@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent....@ideasonboard.com>
---
drivers/media/usb/uvc/uvc_entity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index 7c4d2f93d351..cc68dd24eb42 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -37,7 +37,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
continue;

remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]);
- if (remote == NULL)
+ if (remote == NULL || remote->num_pads == 0)
return -EINVAL;

source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
--
2.39.1


Reply all
Reply to author
Forward
0 new messages