2023-02-22 13:16:52

by syzbot

[permalink] [raw]
Subject: [syzbot] [media?] WARNING in smsusb_term_device

Hello,

syzbot found the following issue on:

HEAD commit: c068f40300a0 Add linux-next specific files for 20230217
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=16e298ef480000
kernel config: https://syzkaller.appspot.com/x/.config?x=e3e2944dd10f2e33
dashboard link: https://syzkaller.appspot.com/bug?extid=40ac6e73326e79ee8ecb
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0351f714d440/disk-c068f403.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0272dec605d9/vmlinux-c068f403.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9813c6350fa4/bzImage-c068f403.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: syz
usb 3-1: Manufacturer: syz
usb 3-1: SerialNumber: syz
usb 3-1: config 0 descriptor??
smsusb:smsusb_probe: board id=7, interface number 0
------------[ cut here ]------------
WARNING: CPU: 0 PID: 897 at kernel/workqueue.c:3167 __flush_work+0x946/0xb60 kernel/workqueue.c:3167
Modules linked in:
CPU: 0 PID: 897 Comm: kworker/0:2 Not tainted 6.2.0-rc8-next-20230217-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Workqueue: usb_hub_wq hub_event
RIP: 0010:__flush_work+0x946/0xb60 kernel/workqueue.c:3167
Code: 00 48 c7 c6 7b 0d 54 81 48 c7 c7 40 79 79 8c e8 e0 0d 12 00 e9 6f fc ff ff e8 b6 85 30 00 0f 0b e9 63 fc ff ff e8 aa 85 30 00 <0f> 0b 45 31 ed e9 54 fc ff ff e8 eb 14 82 00 e9 3e fb ff ff e8 91
RSP: 0018:ffffc90005336c00 EFLAGS: 00010206
RAX: 0000000000036840 RBX: ffff88803f4480e8 RCX: ffffc90014d11000
RDX: 0000000000040000 RSI: ffffffff81540db6 RDI: 0000000000000001
RBP: ffffc90005336d98 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88803f4480e8
R13: 0000000000000001 R14: 0000000000000001 R15: ffff88803f448100
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9f02070edb CR3: 00000000283f5000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3261
smsusb_stop_streaming drivers/media/usb/siano/smsusb.c:182 [inline]
smsusb_term_device+0xef/0x300 drivers/media/usb/siano/smsusb.c:344
smsusb_init_device+0xb6a/0xd10 drivers/media/usb/siano/smsusb.c:419
smsusb_probe+0x5b3/0x10b0 drivers/media/usb/siano/smsusb.c:567
usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:552 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:631
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:998
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x11c4/0x1c50 drivers/base/core.c:3589
usb_set_configuration+0x10ee/0x1af0 drivers/usb/core/message.c:2171
usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238
usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:552 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:631
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:998
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x11c4/0x1c50 drivers/base/core.c:3589
usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575
hub_port_connect drivers/usb/core/hub.c:5407 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5551 [inline]
port_event drivers/usb/core/hub.c:5711 [inline]
hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793
process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390
worker_thread+0x669/0x1090 kernel/workqueue.c:2537
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</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 [email protected].

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


2023-02-26 18:41:47

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [media?] WARNING in smsusb_term_device

syzbot has found a reproducer for the following issue on:

HEAD commit: 8232539f864c Add linux-next specific files for 20230225
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10326960c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4fe68735401a6111
dashboard link: https://syzkaller.appspot.com/bug?extid=40ac6e73326e79ee8ecb
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13ba7cb0c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16734964c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/4259815e0cee/disk-8232539f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5ea6ea28200d/vmlinux-8232539f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e461f15ffd6b/bzImage-8232539f.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

smsusb:smsusb_probe: board id=8, interface number 0
------------[ cut here ]------------
WARNING: CPU: 1 PID: 26 at kernel/workqueue.c:3167 __flush_work+0x946/0xb60 kernel/workqueue.c:3167
Modules linked in:
CPU: 1 PID: 26 Comm: kworker/1:1 Not tainted 6.2.0-next-20230225-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023
Workqueue: usb_hub_wq hub_event
RIP: 0010:__flush_work+0x946/0xb60 kernel/workqueue.c:3167
Code: 00 48 c7 c6 9b 0e 54 81 48 c7 c7 00 77 79 8c e8 00 0c 12 00 e9 6f fc ff ff e8 e6 96 30 00 0f 0b e9 63 fc ff ff e8 da 96 30 00 <0f> 0b 45 31 ed e9 54 fc ff ff e8 bb 22 82 00 e9 3e fb ff ff e8 c1
RSP: 0018:ffffc90000a1ec00 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88807afc00e8 RCX: 0000000000000000
RDX: ffff8880174d1d40 RSI: ffffffff81540ed6 RDI: 0000000000000001
RBP: ffffc90000a1ed98 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807afc00e8
R13: 0000000000000001 R14: 0000000000000001 R15: ffff88807afc0100
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056455268be78 CR3: 000000002a62c000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3261
smsusb_stop_streaming drivers/media/usb/siano/smsusb.c:182 [inline]
smsusb_term_device+0xef/0x300 drivers/media/usb/siano/smsusb.c:344
smsusb_init_device+0xb6a/0xd10 drivers/media/usb/siano/smsusb.c:419
smsusb_probe+0x5b3/0x10b0 drivers/media/usb/siano/smsusb.c:567
usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:552 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:631
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:998
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x11c4/0x1c50 drivers/base/core.c:3589
usb_set_configuration+0x10ee/0x1af0 drivers/usb/core/message.c:2171
usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238
usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:552 [inline]
really_probe+0x240/0xca0 drivers/base/dd.c:631
__driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798
__device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926
bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:998
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x11c4/0x1c50 drivers/base/core.c:3589
usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575
hub_port_connect drivers/usb/core/hub.c:5407 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5551 [inline]
port_event drivers/usb/core/hub.c:5711 [inline]
hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793
process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390
worker_thread+0x669/0x1090 kernel/workqueue.c:2537
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>


2023-02-27 02:26:16

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [media?] WARNING in smsusb_term_device

syzbot has bisected this issue to:

commit ebad8e731c1c06adf04621d6fd327b860c0861b5
Author: Duoming Zhou <[email protected]>
Date: Mon Jan 23 02:04:38 2023 +0000

media: usb: siano: Fix use after free bugs caused by do_submit_urb

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1687af1cc80000
start commit: 8232539f864c Add linux-next specific files for 20230225
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=1587af1cc80000
console output: https://syzkaller.appspot.com/x/log.txt?x=1187af1cc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4fe68735401a6111
dashboard link: https://syzkaller.appspot.com/bug?extid=40ac6e73326e79ee8ecb
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13ba7cb0c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16734964c80000

Reported-by: [email protected]
Fixes: ebad8e731c1c ("media: usb: siano: Fix use after free bugs caused by do_submit_urb")

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

2023-02-27 03:15:33

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [media?] WARNING in smsusb_term_device

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: [email protected]

Tested on:

commit: 8232539f Add linux-next specific files for 20230225
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=14fcfef8c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4fe68735401a6111
dashboard link: https://syzkaller.appspot.com/bug?extid=40ac6e73326e79ee8ecb
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=12d2c2b0c80000

Note: testing is done by a robot and is best-effort only.

2023-03-01 11:29:58

by Duoming Zhou

[permalink] [raw]
Subject: Re: [syzbot] [media?] WARNING in smsusb_term_device

Hello,

On Sun, 26 Feb 2023 18:07:20 -0800 syzbot wrote:

> syzbot has bisected this issue to:
>
> commit ebad8e731c1c06adf04621d6fd327b860c0861b5
> Author: Duoming Zhou <[email protected]>
> Date: Mon Jan 23 02:04:38 2023 +0000
>
> media: usb: siano: Fix use after free bugs caused by do_submit_urb
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1687af1cc80000
> start commit: 8232539f864c Add linux-next specific files for 20230225
> git tree: linux-next
> final oops: https://syzkaller.appspot.com/x/report.txt?x=1587af1cc80000
> console output: https://syzkaller.appspot.com/x/log.txt?x=1187af1cc80000
> kernel config: https://syzkaller.appspot.com/x/.config?x=4fe68735401a6111
> dashboard link: https://syzkaller.appspot.com/bug?extid=40ac6e73326e79ee8ecb
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13ba7cb0c80000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16734964c80000
>
> Reported-by: [email protected]
> Fixes: ebad8e731c1c ("media: usb: siano: Fix use after free bugs caused by do_submit_urb")

Thanks for reporting this issue! I have sent a patch to fix it. The link is below:

https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/

Best regards,
Duoming Zhou