All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [media?] [usb?] WARNING in media_create_pad_link (2)
@ 2025-03-19  7:16 syzbot
  2025-03-25  5:55 ` [syzbot] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: syzbot @ 2025-03-19  7:16 UTC (permalink / raw)
  To: laurent.pinchart, linux-kernel, linux-media, linux-usb, mchehab,
	sakari.ailus, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    3a85c1011540 usb: host: cdns3: forward lost power informat..
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
console output: https://syzkaller.appspot.com/x/log.txt?x=1590f874580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=7e0ed68747dbff9
dashboard link: https://syzkaller.appspot.com/bug?extid=701fc9cc0cb44e2b0fe9
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1726ae54580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1390f874580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eaddfad7c5c2/disk-3a85c101.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d37f14fba48b/vmlinux-3a85c101.xz
kernel image: https://storage.googleapis.com/syzbot-assets/47054ab7f64f/bzImage-3a85c101.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+701fc9cc0cb44e2b0fe9@syzkaller.appspotmail.com

usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: syz
usb 1-1: Manufacturer: syz
usb 1-1: SerialNumber: syz
usb 1-1: config 0 descriptor??
usb 1-1: Found UVC 0.00 device syz (046d:08c3)
usb 1-1: No streaming interface found for terminal 6.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 25 at drivers/media/mc/mc-entity.c:1144 media_create_pad_link+0x5c1/0x760 drivers/media/mc/mc-entity.c:1144
Modules linked in:
CPU: 1 UID: 0 PID: 25 Comm: kworker/1:0 Not tainted 6.14.0-rc6-syzkaller-g3a85c1011540 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: usb_hub_wq hub_event
RIP: 0010:media_create_pad_link+0x5c1/0x760 drivers/media/mc/mc-entity.c:1144
Code: d8 48 83 c4 28 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc e8 70 7e 65 fc 90 0f 0b 90 bb ea ff ff ff eb d6 e8 60 7e 65 fc 90 <0f> 0b 90 eb ee e8 55 7e 65 fc 90 0f 0b 90 eb e3 e8 4a 7e 65 fc 90
RSP: 0018:ffffc900001aef18 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888118fa0880 RCX: ffffffff8515cf70
RDX: ffff888102689d40 RSI: ffffffff8515d490 RDI: 0000000000000002
RBP: ffff888121e9f880 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8ee92ad0 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000003 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8881f5900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffec100cca8 CR3: 0000000122e30000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 uvc_mc_create_links drivers/media/usb/uvc/uvc_entity.c:50 [inline]
 uvc_mc_register_entities+0x3a8/0xaa0 drivers/media/usb/uvc/uvc_entity.c:151
 uvc_register_chains drivers/media/usb/uvc/uvc_driver.c:2142 [inline]
 uvc_probe+0x2859/0x4810 drivers/media/usb/uvc/uvc_driver.c:2278
 usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x23e/0xa90 drivers/base/dd.c:658
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x114b/0x1a70 drivers/base/core.c:3666
 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210
 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250
 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x23e/0xa90 drivers/base/dd.c:658
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x114b/0x1a70 drivers/base/core.c:3666
 usb_new_device+0xd09/0x1a20 drivers/usb/core/hub.c:2663
 hub_port_connect drivers/usb/core/hub.c:5531 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5671 [inline]
 port_event drivers/usb/core/hub.c:5831 [inline]
 hub_event+0x2e58/0x4f40 drivers/usb/core/hub.c:5913
 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3319 [inline]
 worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400
 kthread+0x3af/0x750 kernel/kthread.c:464
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
  2025-03-19  7:16 [syzbot] [media?] [usb?] WARNING in media_create_pad_link (2) syzbot
@ 2025-03-25  5:55 ` syzbot
  2025-11-13  0:45 ` [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2) syzbot
  2025-11-13  7:24 ` Forwarded: " syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-03-25  5:55 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
Author: gshahrouzi@gmail.com

>From 5579a2ebd3af1677dd0bce895328ffb92d014cc6 Mon Sep 17 00:00:00 2001
From: Gabriel Shahrouzi <gshahrouzi@gmail.com>
Date: Mon, 24 Mar 2025 19:45:55 -0400
Subject: [PATCH] media: Fix invalid link creation when source entity has 0
 pads

This patch addresses the warning triggered in the media_create_pad_link()
function, specifically related to the check WARN_ON(source_pad >=
source->num_pads). The fix proposed adds an additional check to ensure that
source->num_pads is non-zero before proceeding with the
media_create_pad_link() function.

Reported-by: syzbot+701fc9cc0cb44e2b0fe9@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=701fc9cc0cb44e2b0fe9
Fixes: a3fbc2e6bb05 ("media: mc-entity.c: use WARN_ON, validate link pads")
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
 drivers/media/usb/uvc/uvc_entity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index cc68dd24eb42..5397ce76c218 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -43,7 +43,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
 		source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
 		       ? (remote->vdev ? &remote->vdev->entity : NULL)
 		       : &remote->subdev.entity;
-		if (source == NULL)
+		if (source == NULL || source->num_pads == 0)
 			continue;
 
 		remote_pad = remote->num_pads - 1;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2)
  2025-03-19  7:16 [syzbot] [media?] [usb?] WARNING in media_create_pad_link (2) syzbot
  2025-03-25  5:55 ` [syzbot] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing syzbot
@ 2025-11-13  0:45 ` syzbot
  2025-11-13  7:24 ` Forwarded: " syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-11-13  0:45 UTC (permalink / raw)
  To: cascardo, gshahrouzi, hansg, hdegoede, hverkuil+cisco,
	kernelmentees, laurent.pinchart, linux-kernel, linux-media,
	linux-usb, mchehab, ribalda, sakari.ailus, skhan, syzkaller-bugs

syzbot suspects this issue was fixed by commit:

commit 0e2ee70291e64a30fe36960c85294726d34a103e
Author: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Date:   Wed Aug 20 16:08:16 2025 +0000

    media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13f0f0b4580000
start commit:   07e27ad16399 Linux 6.17-rc7
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=4d8792ecb6308d0f
dashboard link: https://syzkaller.appspot.com/bug?extid=701fc9cc0cb44e2b0fe9
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12e38142580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12da427c580000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Forwarded: Re: [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2)
  2025-03-19  7:16 [syzbot] [media?] [usb?] WARNING in media_create_pad_link (2) syzbot
  2025-03-25  5:55 ` [syzbot] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing syzbot
  2025-11-13  0:45 ` [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2) syzbot
@ 2025-11-13  7:24 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-11-13  7:24 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2)
Author: ribalda@chromium.org

#syz fix: media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID

On Thu, 13 Nov 2025 at 01:45, syzbot
<syzbot+701fc9cc0cb44e2b0fe9@syzkaller.appspotmail.com> wrote:
>
> syzbot suspects this issue was fixed by commit:
>
> commit 0e2ee70291e64a30fe36960c85294726d34a103e
> Author: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
> Date:   Wed Aug 20 16:08:16 2025 +0000
>
>     media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13f0f0b4580000
> start commit:   07e27ad16399 Linux 6.17-rc7
> git tree:       upstream
> kernel config:  https://syzkaller.appspot.com/x/.config?x=4d8792ecb6308d0f
> dashboard link: https://syzkaller.appspot.com/bug?extid=701fc9cc0cb44e2b0fe9
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12e38142580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12da427c580000
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
> #syz fix: media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-13  7:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19  7:16 [syzbot] [media?] [usb?] WARNING in media_create_pad_link (2) syzbot
2025-03-25  5:55 ` [syzbot] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing syzbot
2025-11-13  0:45 ` [syzbot] [usb?] [media?] WARNING in media_create_pad_link (2) syzbot
2025-11-13  7:24 ` Forwarded: " syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.