[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: a7bb96b18864225a694e3887ac2733159489e4b0
WARNING: Author mismatch between patch and upstream commit: Backport author: jianqi.ren.cn@windriver.com Commit author: Abhishek Tamboliabhishektamboli9@gmail.com
Status in newer kernel trees: 6.13.y | Present (exact SHA1) 6.12.y | Present (exact SHA1)
Note: The patch differs from the upstream commit: --- 1: a7bb96b188642 ! 1: bb53b578c3dc2 usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c @@ Metadata ## Commit message ## usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c
+ [ Upstream commit a7bb96b18864225a694e3887ac2733159489e4b0 ] + Fix potential dereferencing of ERR_PTR() in find_format_by_pix() and uvc_v4l2_enum_format().
@@ Commit message Signed-off-by: Abhishek Tamboli abhishektamboli9@gmail.com Link: https://lore.kernel.org/r/20240815102202.594812-1-abhishektamboli9@gmail.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org + Signed-off-by: Jianqi Ren jianqi.ren.cn@windriver.com + Signed-off-by: He Zhe zhe.he@windriver.com
## drivers/usb/gadget/function/uvc_v4l2.c ## @@ drivers/usb/gadget/function/uvc_v4l2.c: static struct uvcg_format *find_format_by_pix(struct uvc_device *uvc, @@ drivers/usb/gadget/function/uvc_v4l2.c: uvc_v4l2_try_format(struct file *file, v
if (fmt->type != video->queue.queue.type) @@ drivers/usb/gadget/function/uvc_v4l2.c: uvc_v4l2_try_format(struct file *file, void *fh, struct v4l2_format *fmt) - fmt->fmt.pix.height = uframe->frame.w_height; - fmt->fmt.pix.bytesperline = uvc_v4l2_get_bytesperline(uformat, uframe); - fmt->fmt.pix.sizeimage = uvc_get_frame_size(uformat, uframe); -- fmt->fmt.pix.pixelformat = to_uvc_format(uformat)->fcc; -+ fmtdesc = to_uvc_format(uformat); -+ if (IS_ERR(fmtdesc)) -+ return PTR_ERR(fmtdesc); -+ fmt->fmt.pix.pixelformat = fmtdesc->fcc; - } fmt->fmt.pix.field = V4L2_FIELD_NONE; + fmt->fmt.pix.bytesperline = uvc_v4l2_get_bytesperline(uformat, uframe); + fmt->fmt.pix.sizeimage = uvc_get_frame_size(uformat, uframe); +- fmt->fmt.pix.pixelformat = to_uvc_format(uformat)->fcc; ++ fmtdesc = to_uvc_format(uformat); ++ if (IS_ERR(fmtdesc)) ++ return PTR_ERR(fmtdesc); ++ fmt->fmt.pix.pixelformat = fmtdesc->fcc; fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; + fmt->fmt.pix.priv = 0; + @@ drivers/usb/gadget/function/uvc_v4l2.c: uvc_v4l2_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f) return -EINVAL;
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |