[PATCH v1 0/3] usb: gadget: uvc: stability fixes on STREAMOFF.

From: Avichal Rakesh
Date: Sat Sep 30 2023 - 14:49:15 EST


We have been seeing two main stability issues that uvc gadget driver
runs into when stopping streams:
1. Attempting to queue usb_requests to a disabled usb_ep
2. use-after-free issue for inflight usb_requests

The three patches below fix the two issues above. Patch 1/3 fixes the
first issue, and Patch 2/3 and 3/3 fix the second issue.

Avichal Rakesh (3):
usb: gadget: uvc: prevent use of disabled endpoint
usb: gadget: uvc: Allocate uvc_requests one at a time
usb: gadget: uvc: Fix use-after-free for inflight usb_requests

drivers/usb/gadget/function/f_uvc.c | 11 +-
drivers/usb/gadget/function/f_uvc.h | 2 +-
drivers/usb/gadget/function/uvc.h | 6 +-
drivers/usb/gadget/function/uvc_v4l2.c | 21 ++-
drivers/usb/gadget/function/uvc_video.c | 189 +++++++++++++++++-------
5 files changed, 164 insertions(+), 65 deletions(-)

--
2.42.0.582.g8ccd20d70d-goog