lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKUZ0z+V0pBvAf1VRGcWf_QcROZFsTUcHmNM1T1=DpBw56yi8A@mail.gmail.com>
Date: Tue, 8 Apr 2025 01:35:00 -0400
From: Gabriel Shahrouzi <gshahrouzi@...il.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: Ricardo Ribalda <ribalda@...omium.org>, hdegoede@...hat.com, mchehab@...nel.org, 
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, 
	syzbot+701fc9cc0cb44e2b0fe9@...kaller.appspotmail.com, 
	skhan@...uxfoundation.org, kernelmentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] media: Fix invalid link creation when source entity has 0 pads

On Tue, Apr 1, 2025 at 8:30 PM Laurent Pinchart
<laurent.pinchart@...asonboard.com> wrote:
>
> Hi Gabriel,
>
> On Sat, Mar 29, 2025 at 01:50:00PM -0400, Gabriel wrote:
> > Hi Laurent,
> >
> > I’ve analyzed the bug report, and the root cause of the
> > "WARNING-media_create_pad_link" issue is a mismatch in terminal
> > references in the USB descriptor.
> >
> > The format type descriptor references terminal ID 6, while the audio
> > streaming interface descriptor points to terminal ID 5. This
> > discrepancy triggers the warning: "No streaming interface found for
> > terminal 6", followed by the media pad link warning.
>
> Can you share the USB descriptors.
The USB descriptors via the Syzkaller reproducer:
         "\x12\x01\x00\x00\xfb\x5d\x7d\x08\x6d\x04\xc3\x08\x16\x6b\x01\x02\x03"
         "\x01\x09\x02\x50\x00\x01\x00\x00\x00\x00\x09\x04\x1f\x00\x00\xff\x01"
         "\x00\x00\x0a\x24\x02\x00\x00\x05\x02\x01\x02\x07\x24\x07\x05\x00\x00"
         "\x18\xc2\x24\x08\x05\x04\x00\x04\x96\x0d\x24\x06\x01\x01\x03\x02\x00"
         "\x01\x00\x06\x00\x06\x09\x24\x03\x05\x05\x03\x06\x05\x81\x09\x24\x03"
         "\x06\x01\x01\x04\x05\x05\x07\x24\x04\x05\x01\x00\x9c\xbd\x89"
>
> > I confirmed this by changing the terminal ID in the format descriptor
> > from 6 to 5, which eliminates both warnings. This shows the warning is
> > correctly identifying an invalid descriptor configuration, not a
> > kernel bug.
>
> There's still something not quite right. uvc_entity->num_pads should
> always be equal to the corresponding media_entity->num_pads. That's not
> the case here, and I think it indicates a bug.
Ah ok - the mismatch itself shouldn't happen regardless of the descriptor
>
> > Since the USB descriptor is invalid, I believe the warning is
> > necessary and should remain. The code should stay as is.
>
> There should be a warning, but I think it needs to be caught in a
> different place, earlier.
Got it.
>
> > On Tue, Mar 25, 2025 at 8:13 PM Laurent Pinchart wrote:
> > >
> > > On Tue, Mar 25, 2025 at 06:05:00PM -0400, Gabriel wrote:
> > > > Hi Ricardo,
> > > >
> > > > > I cannot reach that URL
> > > > I was unable to access the URL from my email client when I initially
> > > > sent the email, but a couple of hours later, I was able to. Initially,
> > > > copying and pasting the URL into the browser provided a workaround.
> > > >
> > > > > Shouldn't it be?:
> > > > > Fixes: 4ffc2d89f38a ("[media] uvcvideo: Register subdevices for each entity")
> > > > You're right, I incorrectly referenced the wrong commit. However, I’m
> > > > not certain if it should reference a96aa5342d57 (Fixes: a96aa5342d57 -
> > > > '[media] uvcvideo: Ignore entities for terminals with no supported
> > > > format') as it's the latest commit affecting the line I'm changing or
> > > > the one you mentioned.
> > > >
> > > > > Shouldn't source->num_pads be the same as remote->num_pads?
> > > > The fuzzer (Syzkaller) that triggered the warning appears to have
> > > > encountered a case where source->num_pads and remote->num_pads were
> > > > different. When analyzing the case in GDB, remote->num_pads was 1,
> > > > while source->num_pads was 0.
> > >
> > > This seems like the real bug that should be fixed.
> > >
> > > > > Are you sure that your kernel does not contain?
> > > > > https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/media/usb/uvc/uvc_entity.c?id=41ddb251c68ac75c101d3a50a68c4629c9055e4c
> > > > Yes, it should be included since I am running the upstream kernel.
>
> --
> Regards,
>
> Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ