* [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame [not found] <20260820111556.232652-1-natalie.klaus@runtimeverification.com> @ 2026-08-20 11:15 ` Natasha Klaus 2026-09-28 20:50 ` Laurent Pinchart 2026-08-20 11:15 ` [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation Natasha Klaus 1 sibling, 1 reply; 6+ messages in thread From: Natasha Klaus @ 2026-08-20 11:15 UTC (permalink / raw) To: laurent.pinchart, hansg, mchehab Cc: ribalda, noambs2999, david.laight.linux, linux-media, linux-kernel, Natasha Klaus, stable uvc_parse_frame() returns the descriptor length on success and a negative error code on failure, and uvc_parse_format() treats every negative value as fatal for the whole streaming interface. There is no way for the parser to say "this frame descriptor is unusable, but the rest of the format is fine". Change the return convention so it can. Return 0 on success and let the caller advance by buffer[0], which is the value the function returned anyway. Report a truncated descriptor with -ENODATA, which stays fatal, and leave every other negative value to mean "skip this frame descriptor and carry on with the next one". -ENODATA is currently the only error the function can return, so the skip path is unreachable until later patches add checks that use it. The one behavioural change is the truncated-descriptor diagnostic, which moves from uvc_dbg() to dev_warn() so a malformed descriptor is reported without the DESCR debug flag. That leaves the local alts variable unused, and the kernel builds -Wunused-variable as an error, so it goes too. Suggested-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://lore.kernel.org/linux-media/CANiDSCue8yyiGubzbAybRqSUTTFuB=-Y2TZy6yvOx32SpAASWg@mail.gmail.com/ Cc: stable@vger.kernel.org Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Tested-by: Noam Ben Shimon <noambs2999@gmail.com> Signed-off-by: Natasha Klaus <natalie.klaus@runtimeverification.com> --- The Cc: stable line is present without a Fixes: tag because this patch is a prerequisite for 2/3 rather than a fix in its own right. Stable needs both or neither: backported alone, 2/3's -EINVAL would revert to meaning "discard the whole streaming interface". The caller checks -ENODATA before counting the frame, per Ricardo's review. Behaviour is unchanged either way, since -ENODATA is non-zero, but the fatal case reads better first. drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index e289cc71ba98..b94fe5366e55 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -230,7 +230,6 @@ static int uvc_parse_frame(struct uvc_device *dev, u32 **intervals, u8 ftype, int width_multiplier, const unsigned char *buffer, int buflen) { - struct usb_host_interface *alts = streaming->intf->cur_altsetting; unsigned int maxIntervalIndex; unsigned int interval; unsigned int i, n; @@ -243,10 +242,10 @@ static int uvc_parse_frame(struct uvc_device *dev, n = n ? n : 3; if (buflen < 26 + 4 * n) { - uvc_dbg(dev, DESCR, - "device %d videostreaming interface %d FRAME error\n", - dev->udev->devnum, alts->desc.bInterfaceNumber); - return -EINVAL; + dev_warn(&streaming->intf->dev, + "UVC non compliance: FRAME descriptor is %d bytes, expected at least %u.\n", + buflen, 26 + 4 * n); + return -ENODATA; } frame->bFrameIndex = buffer[3]; @@ -329,7 +328,7 @@ static int uvc_parse_frame(struct uvc_device *dev, *intervals += n; - return buffer[0]; + return 0; } static int uvc_parse_format(struct uvc_device *dev, @@ -492,11 +491,12 @@ static int uvc_parse_format(struct uvc_device *dev, ret = uvc_parse_frame(dev, streaming, format, frame, intervals, ftype, width_multiplier, buffer, buflen); - if (ret < 0) + if (ret == -ENODATA) return ret; - format->nframes++; - buflen -= ret; - buffer += ret; + if (!ret) + format->nframes++; + buflen -= buffer[0]; + buffer += buffer[0]; } } -- 2.34.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame 2026-08-20 11:15 ` [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame Natasha Klaus @ 2026-09-28 20:50 ` Laurent Pinchart 2026-09-30 10:33 ` Natasha Klaus 0 siblings, 1 reply; 6+ messages in thread From: Laurent Pinchart @ 2026-09-28 20:50 UTC (permalink / raw) To: Natasha Klaus Cc: hansg, mchehab, ribalda, noambs2999, david.laight.linux, linux-media, linux-kernel, stable On Thu, Aug 20, 2026 at 02:15:54PM +0300, Natasha Klaus wrote: > uvc_parse_frame() returns the descriptor length on success and a > negative error code on failure, and uvc_parse_format() treats every > negative value as fatal for the whole streaming interface. There is no > way for the parser to say "this frame descriptor is unusable, but the > rest of the format is fine". On what device have you seen this occurring ? How did you test this patch ? > Change the return convention so it can. Return 0 on success and let the > caller advance by buffer[0], which is the value the function returned > anyway. Report a truncated descriptor with -ENODATA, which stays fatal, > and leave every other negative value to mean "skip this frame descriptor > and carry on with the next one". > > -ENODATA is currently the only error the function can return, so the > skip path is unreachable until later patches add checks that use it. The > one behavioural change is the truncated-descriptor diagnostic, which > moves from uvc_dbg() to dev_warn() so a malformed descriptor is reported > without the DESCR debug flag. That leaves the local alts variable > unused, and the kernel builds -Wunused-variable as an error, so it goes > too. > > Suggested-by: Ricardo Ribalda <ribalda@chromium.org> > Link: https://lore.kernel.org/linux-media/CANiDSCue8yyiGubzbAybRqSUTTFuB=-Y2TZy6yvOx32SpAASWg@mail.gmail.com/ > Cc: stable@vger.kernel.org > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> > Tested-by: Noam Ben Shimon <noambs2999@gmail.com> > Signed-off-by: Natasha Klaus <natalie.klaus@runtimeverification.com> > --- > The Cc: stable line is present without a Fixes: tag because this patch is > a prerequisite for 2/3 rather than a fix in its own right. Stable needs > both or neither: backported alone, 2/3's -EINVAL would revert to meaning > "discard the whole streaming interface". > > The caller checks -ENODATA before counting the frame, per Ricardo's review. > Behaviour is unchanged either way, since -ENODATA is non-zero, but the fatal > case reads better first. > > drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c > index e289cc71ba98..b94fe5366e55 100644 > --- a/drivers/media/usb/uvc/uvc_driver.c > +++ b/drivers/media/usb/uvc/uvc_driver.c > @@ -230,7 +230,6 @@ static int uvc_parse_frame(struct uvc_device *dev, > u32 **intervals, u8 ftype, int width_multiplier, > const unsigned char *buffer, int buflen) > { > - struct usb_host_interface *alts = streaming->intf->cur_altsetting; > unsigned int maxIntervalIndex; > unsigned int interval; > unsigned int i, n; > @@ -243,10 +242,10 @@ static int uvc_parse_frame(struct uvc_device *dev, > n = n ? n : 3; > > if (buflen < 26 + 4 * n) { > - uvc_dbg(dev, DESCR, > - "device %d videostreaming interface %d FRAME error\n", > - dev->udev->devnum, alts->desc.bInterfaceNumber); > - return -EINVAL; > + dev_warn(&streaming->intf->dev, > + "UVC non compliance: FRAME descriptor is %d bytes, expected at least %u.\n", > + buflen, 26 + 4 * n); > + return -ENODATA; > } > > frame->bFrameIndex = buffer[3]; > @@ -329,7 +328,7 @@ static int uvc_parse_frame(struct uvc_device *dev, > > *intervals += n; > > - return buffer[0]; > + return 0; > } > > static int uvc_parse_format(struct uvc_device *dev, > @@ -492,11 +491,12 @@ static int uvc_parse_format(struct uvc_device *dev, > ret = uvc_parse_frame(dev, streaming, format, frame, > intervals, ftype, width_multiplier, > buffer, buflen); > - if (ret < 0) > + if (ret == -ENODATA) > return ret; > - format->nframes++; > - buflen -= ret; > - buffer += ret; > + if (!ret) > + format->nframes++; > + buflen -= buffer[0]; > + buffer += buffer[0]; > } > } > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame 2026-09-28 20:50 ` Laurent Pinchart @ 2026-09-30 10:33 ` Natasha Klaus 0 siblings, 0 replies; 6+ messages in thread From: Natasha Klaus @ 2026-09-30 10:33 UTC (permalink / raw) To: laurent.pinchart Cc: david.laight.linux, hansg, linux-kernel, linux-media, mchehab, natalie.klaus, noambs2999, ribalda, stable On Mon, Sep 28, 2026, Laurent Pinchart wrote: > On what device have you seen this occurring ? How did you test this > patch ? On no device. Noam found the overflow by reading the code. The zero size case came from my review of his patch, done with an LLM tool (see my reply on 2/3). There is no user report behind either. 1/3 is the refactor Ricardo suggested on the list, so that 2/3 and 3/3 can drop one bad frame instead of the whole streaming interface. Apart from the truncated descriptor message moving to dev_warn(), it changes no behaviour on its own. Testing: Noam ran the series on a UVC gadget over dummy_hcd. One format had an over-U32_MAX frame, a zero-size frame and a valid frame. Both bad frames were skipped and the valid one was exposed. I built it on x86_64. Not tested: any physical camera, the -ENODATA truncated descriptor path, 32-bit builds. Natasha ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation [not found] <20260820111556.232652-1-natalie.klaus@runtimeverification.com> 2026-08-20 11:15 ` [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame Natasha Klaus @ 2026-08-20 11:15 ` Natasha Klaus 2026-09-28 20:53 ` Laurent Pinchart 1 sibling, 1 reply; 6+ messages in thread From: Natasha Klaus @ 2026-08-20 11:15 UTC (permalink / raw) To: laurent.pinchart, hansg, mchehab Cc: ribalda, noambs2999, david.laight.linux, linux-media, linux-kernel, stable, Natasha Klaus From: Noam Ben Shimon <noambs2999@gmail.com> In the function uvc_parse_frame(), it recomputes dwMaxVideoFrameBufferSize for uncompressed formats. This helps working around devices that report it wrong: frame->dwMaxVideoFrameBufferSize = format->bpp * frame->wWidth * frame->wHeight / 8; These three arguments originate from the device's own descriptors, and therefore can be decided by it. bpp is a u8 and wWidth and wHeight are u16. The expression is evaluated in int, and the maximum value is 255 * 65535 * 65535 (which is roughly 510 times INT_MAX). A device that declares large dimensions therefore overflows a signed int here. The kernel is built using -fno-strict-overflow, so this wraps rather than being miscompiled, but the wrapped value (which is often negative) is then divided by 8 and stored in a u32 used as a size. Two examples for this (using legal field values): - 32 bpp, 16384x4096: the product is exactly 2^31 and wraps to INT_MIN. After division and conversion to u32 the field has the value 4026531840 rather than 268435456. - 16 bpp, 16384x16384: the product is exactly 2^32 and wraps to 0. The field holds 0, rather than the correct 536870912. I don't think memory corruption is a consequence of this. The value reaches uvc_queue_setup() as the vb2 buffer size, and every copy on the decode path is bounded by buf->length, which uvc_buffer_prepare() gets from vb2_plane_size() rather than this field. What a wrapped value does instead is make the driver describe the stream inconsistently. For an uncompressed format uvc_fixup_video_ctrl() copies it into ctrl->dwMaxVideoFrameSize unconditionally, and that becomes the sizeimage reported by VIDIOC_G_FMT. This is while width, height and bytesperline continue to describe the full frame. This also makes uvc_video_validate_buffer() mark error on all frames, because it is comparing bytesused against the same number. Compute the size in 64-bit, and if the result does not fit in the u32 field then skip the frame descriptor. An uncompressed frame this large is probably not a real device, and skipping it leaves the rest of the format and the streaming interface usable. The rounding also changes from truncation to round-up. Truncation is pre-existing rather than introduced here: the original expression used integer division, so it has rounded a partial trailing byte away since the driver was merged. Rounding up is the right direction for a buffer size, and DIV_ROUND_UP() against BITS_PER_BYTE is what the rest of the media tree uses for this computation, including uvc_parse_format() itself for the FORCE_BPP quirk. Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver") Cc: stable@vger.kernel.org Signed-off-by: Noam Ben Shimon <noambs2999@gmail.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Tested-by: Noam Ben Shimon <noambs2999@gmail.com> Signed-off-by: Natasha Klaus <natalie.klaus@runtimeverification.com> --- Changes from Noam's v2: - Rebased onto patch 1/3; this patch no longer applies standalone. - Diagnostic changed from uvc_dbg(dev, DESCR, ...) to dev_warn() on &streaming->intf->dev, reworded to begin "UVC non compliance: " and to say the frame is skipped. The explicit device and interface numbers are dropped from the message text because dev_warn() already identifies the interface. (The original could not be kept as-is in any case: patch 1/3 removes the local alts variable it referenced.) - bpp, wWidth and wHeight added to the message text (David Laight), matching the wording of the diagnostic in 3/3. - The >> 3 replaced with DIV_ROUND_UP() against BITS_PER_BYTE (David Laight), so a partial trailing byte is no longer dropped. The overflow check is applied to the rounded-up value. - The return value is still -EINVAL; what changed is its meaning, which patch 1/3 redefines as "skip this frame descriptor" rather than "fail the whole streaming interface". - Last paragraph of the commit message reworded from "reject the frame descriptor ... rejection is consistent with the other checks over malformed-descriptors in this function" to describe skipping instead, and a paragraph added on the rounding change. - Ricardo Ribalda's Reviewed-by dropped, as it was given on the unmodified v2. - Submitter's Signed-off-by added. - Fixes: and Cc: stable lines unchanged. - DIV_ROUND_UP changed to DIV_ROUND_UP_ULL per Ricardo's review. Rounding up also moves the U32_MAX boundary: two inputs within the field limits (bpp=79 at 10077x43161 and bpp=237 at 3359x43161) landed exactly on U32_MAX with the old truncation and are now rejected, since the rounded-up size is not representable. Build tested on x86_64; see the cover letter for Noam's gadget testing. drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index b94fe5366e55..d7d71418f875 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -295,9 +295,21 @@ static int uvc_parse_frame(struct uvc_device *dev, * information. For uncompressed formats this can be fixed by computing * the value from the frame size. */ - if (!(format->flags & UVC_FMT_FLAG_COMPRESSED)) - frame->dwMaxVideoFrameBufferSize = format->bpp * frame->wWidth - * frame->wHeight / 8; + if (!(format->flags & UVC_FMT_FLAG_COMPRESSED)) { + u64 bufsize; + + bufsize = DIV_ROUND_UP_ULL((u64)format->bpp * frame->wWidth * + frame->wHeight, BITS_PER_BYTE); + if (bufsize > U32_MAX) { + dev_warn(&streaming->intf->dev, + "UVC non compliance: FRAME %u computed buffer size overflows (%ux%u, %u bpp), skipping it.\n", + frame->bFrameIndex, frame->wWidth, + frame->wHeight, format->bpp); + return -EINVAL; + } + + frame->dwMaxVideoFrameBufferSize = bufsize; + } /* * Clamp the default frame interval to the boundaries. A zero -- 2.34.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation 2026-08-20 11:15 ` [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation Natasha Klaus @ 2026-09-28 20:53 ` Laurent Pinchart 2026-09-30 8:58 ` Natasha Klaus 0 siblings, 1 reply; 6+ messages in thread From: Laurent Pinchart @ 2026-09-28 20:53 UTC (permalink / raw) To: Natasha Klaus Cc: hansg, mchehab, ribalda, noambs2999, david.laight.linux, linux-media, linux-kernel, stable On Thu, Aug 20, 2026 at 02:15:55PM +0300, Natasha Klaus wrote: > From: Noam Ben Shimon <noambs2999@gmail.com> > > In the function uvc_parse_frame(), it recomputes > dwMaxVideoFrameBufferSize for uncompressed formats. This helps working > around devices that report it wrong: > > frame->dwMaxVideoFrameBufferSize = format->bpp * frame->wWidth > * frame->wHeight / 8; > > These three arguments originate from the device's own descriptors, and > therefore can be decided by it. bpp is a u8 and wWidth and wHeight are > u16. The expression is evaluated in int, and the maximum value is > 255 * 65535 * 65535 (which is roughly 510 times INT_MAX). > A device that declares large dimensions therefore overflows a signed > int here. > The kernel is built using -fno-strict-overflow, so this wraps rather > than being miscompiled, but the wrapped value (which is often negative) > is then divided by 8 and stored in a u32 used as a size. > > Two examples for this (using legal field values): > > - 32 bpp, 16384x4096: the product is exactly 2^31 and wraps to > INT_MIN. After division and conversion to u32 the field has the > value 4026531840 rather than 268435456. > > - 16 bpp, 16384x16384: the product is exactly 2^32 and wraps to 0. > The field holds 0, rather than the correct 536870912. > > I don't think memory corruption is a consequence of this. The value > reaches uvc_queue_setup() as the vb2 buffer size, and every copy on the > decode path is bounded by buf->length, which uvc_buffer_prepare() gets > from vb2_plane_size() rather than this field. What a wrapped value does > instead is make the driver describe the stream inconsistently. > For an uncompressed format uvc_fixup_video_ctrl() copies it into > ctrl->dwMaxVideoFrameSize unconditionally, and that becomes the > sizeimage reported by VIDIOC_G_FMT. This is while width, height and > bytesperline continue to describe the full frame. > This also makes uvc_video_validate_buffer() mark error on all frames, > because it is comparing bytesused against the same number. > > Compute the size in 64-bit, and if the result does not fit in the u32 > field then skip the frame descriptor. An uncompressed frame this large > is probably not a real device, and skipping it leaves the rest of the > format and the streaming interface usable. > > The rounding also changes from truncation to round-up. Truncation is > pre-existing rather than introduced here: the original expression used > integer division, so it has rounded a partial trailing byte away since > the driver was merged. Rounding up is the right direction for a buffer > size, and DIV_ROUND_UP() against BITS_PER_BYTE is what the rest of the > media tree uses for this computation, including uvc_parse_format() > itself for the FORCE_BPP quirk. > > Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver") > Cc: stable@vger.kernel.org > Signed-off-by: Noam Ben Shimon <noambs2999@gmail.com> > Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> > Tested-by: Noam Ben Shimon <noambs2999@gmail.com> > Signed-off-by: Natasha Klaus <natalie.klaus@runtimeverification.com> Is this patch missing an Assisted-by tag ? I also want to know what device this has been tested with. > --- > Changes from Noam's v2: > - Rebased onto patch 1/3; this patch no longer applies standalone. > - Diagnostic changed from uvc_dbg(dev, DESCR, ...) to dev_warn() on > &streaming->intf->dev, reworded to begin "UVC non compliance: " and to > say the frame is skipped. The explicit device and interface numbers are > dropped from the message text because dev_warn() already identifies the > interface. (The original could not be kept as-is in any case: patch 1/3 > removes the local alts variable it referenced.) > - bpp, wWidth and wHeight added to the message text (David Laight), matching > the wording of the diagnostic in 3/3. > - The >> 3 replaced with DIV_ROUND_UP() against BITS_PER_BYTE (David Laight), > so a partial trailing byte is no longer dropped. The overflow check is > applied to the rounded-up value. > - The return value is still -EINVAL; what changed is its meaning, which > patch 1/3 redefines as "skip this frame descriptor" rather than "fail the > whole streaming interface". > - Last paragraph of the commit message reworded from "reject the frame > descriptor ... rejection is consistent with the other checks over > malformed-descriptors in this function" to describe skipping instead, and > a paragraph added on the rounding change. > - Ricardo Ribalda's Reviewed-by dropped, as it was given on the unmodified > v2. > - Submitter's Signed-off-by added. > - Fixes: and Cc: stable lines unchanged. > - DIV_ROUND_UP changed to DIV_ROUND_UP_ULL per Ricardo's review. > > Rounding up also moves the U32_MAX boundary: two inputs within the field > limits (bpp=79 at 10077x43161 and bpp=237 at 3359x43161) landed exactly on > U32_MAX with the old truncation and are now rejected, since the rounded-up > size is not representable. > > Build tested on x86_64; see the cover letter for Noam's gadget testing. > > drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c > index b94fe5366e55..d7d71418f875 100644 > --- a/drivers/media/usb/uvc/uvc_driver.c > +++ b/drivers/media/usb/uvc/uvc_driver.c > @@ -295,9 +295,21 @@ static int uvc_parse_frame(struct uvc_device *dev, > * information. For uncompressed formats this can be fixed by computing > * the value from the frame size. > */ > - if (!(format->flags & UVC_FMT_FLAG_COMPRESSED)) > - frame->dwMaxVideoFrameBufferSize = format->bpp * frame->wWidth > - * frame->wHeight / 8; > + if (!(format->flags & UVC_FMT_FLAG_COMPRESSED)) { > + u64 bufsize; > + > + bufsize = DIV_ROUND_UP_ULL((u64)format->bpp * frame->wWidth * > + frame->wHeight, BITS_PER_BYTE); See the reply I just sent on v1. > + if (bufsize > U32_MAX) { > + dev_warn(&streaming->intf->dev, > + "UVC non compliance: FRAME %u computed buffer size overflows (%ux%u, %u bpp), skipping it.\n", > + frame->bFrameIndex, frame->wWidth, > + frame->wHeight, format->bpp); > + return -EINVAL; > + } > + > + frame->dwMaxVideoFrameBufferSize = bufsize; > + } > > /* > * Clamp the default frame interval to the boundaries. A zero -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation 2026-09-28 20:53 ` Laurent Pinchart @ 2026-09-30 8:58 ` Natasha Klaus 0 siblings, 0 replies; 6+ messages in thread From: Natasha Klaus @ 2026-09-30 8:58 UTC (permalink / raw) To: laurent.pinchart Cc: david.laight.linux, hansg, linux-kernel, linux-media, mchehab, natalie.klaus, noambs2999, ribalda, stable On Mon, Sep 28, 2026, Laurent Pinchart wrote: > Is this patch missing an Assisted-by tag ? Yes, and I should have disclosed it in v3. I used Claude Code for this series: - 1/3: Ricardo's design, from his diff on the list. Claude Code applied it, found it did not build (alts left unused) and wrote the dev_warn() text. - 3/3: my design (skip rather than reject, inside the uncompressed branch, same approach as 81f3affa19d6). Claude Code wrote the code, I wrote the comment. - Commit messages and notes: drafted by Claude Code from a list of required content I gave it, then edited by me. In 2/3 this covers my changes to Noam's text, not his original. - Analysis: the call path analysis in my review mails and the zero size case behind 3/3 were found by Claude Code. I spot-checked them against the tree. I reviewed and approved every change and built each commit. v4 will carry Assisted-by on all three patches, say in 3/3 how the zero size case was found, and describe the tool use in the cover letter. The original patch in 2/3 is Noam's. I have asked him to answer for his part. > I also want to know what device this has been tested with. No physical device. Only Noam's UVC gadget over dummy_hcd, details in my reply on 1/3. > > + bufsize = DIV_ROUND_UP_ULL((u64)format->bpp * frame->wWidth * > > + frame->wHeight, BITS_PER_BYTE); > > See the reply I just sent on v1. Thanks for the numbers. If width * bpp is always a multiple of 8, rounding up and truncating give the same result on any real device. They differ only for descriptors that are already broken. I kept DIV_ROUND_UP_ULL to match the FORCE_BPP path in uvc_parse_format(). I can go back to a plain shift if you prefer. Which one do you want in v4? Natasha ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-30 10:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260820111556.232652-1-natalie.klaus@runtimeverification.com>
2026-08-20 11:15 ` [PATCH v3 1/3] media: uvcvideo: Let uvc_parse_frame() report a skipped frame Natasha Klaus
2026-09-28 20:50 ` Laurent Pinchart
2026-09-30 10:33 ` Natasha Klaus
2026-08-20 11:15 ` [PATCH v3 2/3] media: uvcvideo: Fix integer overflow in frame buffer size calculation Natasha Klaus
2026-09-28 20:53 ` Laurent Pinchart
2026-09-30 8:58 ` Natasha Klaus
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox