Files
linux/drivers
Avichal Rakesh 20853add09 FROMGIT: usb: gadget: uvc: Allocate uvc_requests one at a time
Currently, the uvc gadget driver allocates all uvc_requests as one array
and deallocates them all when the video stream stops. This includes
de-allocating all the usb_requests associated with those uvc_requests.
This can lead to use-after-free issues if any of those de-allocated
usb_requests were still owned by the usb controller.

This patch is 1 of 2 patches addressing the use-after-free issue.
Instead of bulk allocating all uvc_requests as an array, this patch
allocates uvc_requests one at a time, which should allows for similar
granularity when deallocating the uvc_requests. This patch has no
functional changes other than allocating each uvc_request separately,
and similarly freeing each of them separately.

Link: https://lore.kernel.org/7cd81649-2795-45b6-8c10-b7df1055020d@google.com
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Suggested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Avichal Rakesh <arakesh@google.com>
Link: https://lore.kernel.org/r/20231109004104.3467968-2-arakesh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 296925310
(cherry picked from commit aeb686a98a9e9743c4c0338957e59643a2708146
 https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb usb-next)
Change-Id: I33400ac6b28e72c6c10805e167e8bab7e2520a28
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-11-28 02:25:57 +00:00
..
2023-09-12 12:36:39 +00:00
2023-09-12 12:36:39 +00:00
2023-07-23 13:49:43 +02:00
2023-09-12 12:36:39 +00:00
2023-09-02 19:41:42 +00:00
2023-06-14 19:17:01 +00:00
2023-09-12 12:36:39 +00:00
2023-06-28 10:19:08 +00:00
2023-09-12 12:36:39 +00:00
2023-09-12 12:36:39 +00:00
2023-09-12 12:36:39 +00:00
2023-09-12 12:36:39 +00:00
2023-09-05 16:35:01 +00:00
2023-09-05 16:35:01 +00:00
2023-07-19 16:21:57 +02:00
2023-06-21 18:23:46 +00:00
2023-04-06 12:10:44 +02:00
2023-09-05 16:35:01 +00:00
2023-09-05 16:35:01 +00:00
2023-09-06 10:23:12 +00:00
2023-06-14 19:49:28 +00:00
2023-09-02 19:41:42 +00:00
2023-09-06 10:23:12 +00:00
2023-07-19 16:21:48 +02:00
2023-09-12 12:36:39 +00:00