Extracting prog: 2m36.108054443s
Minimizing prog: 5m55.700431093s
Simplifying prog options: 6m56.017126699s
Extracting C: 34.922675161s
Simplifying C: 0s
extracting reproducer from 1 programs
testing a last program of every proc
single: executing 1 programs separately with timeout 30s
testing program (duration=30s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
single: successfully extracted reproducer
found reproducer with 2 syscalls
minimizing guilty program
testing program (duration=49.847921149s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
program did not crash
testing program (duration=49.847921149s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program did not crash
testing program (duration=49.847921149s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, 0x0, 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program did not crash
testing program (duration=49.847921149s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program did not crash
extracting C reproducer
testing compiled C program (duration=49.847921149s, {Threaded:true Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
program did not crash
simplifying guilty program options
testing program (duration=49.847921149s, {Threaded:false Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
extracting C reproducer
testing compiled C program (duration=49.847921149s, {Threaded:false Repeat:true RepeatTimes:0 Procs:5 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
program did not crash
testing program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
extracting C reproducer
testing compiled C program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:namespace SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
program did not crash
testing program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
extracting C reproducer
testing compiled C program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
program did not crash
testing program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
validation run: crashed=true
testing program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
validation run: crashed=true
testing program (duration=49.847921149s, {Threaded:false Repeat:false RepeatTimes:0 Procs:1 Slowdown:1 Sandbox:none SandboxArg:0 Leak:false NetInjection:true NetDevices:true NetReset:false Cgroups:false BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false NicVF:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true Swap:true UseTmpDir:true HandleSegv:true Trace:false CallComments:true LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}): syz_usb_connect-syz_open_dev$char_usb
detailed listing:
executing program 0:
syz_usb_connect(0x0, 0x40, &(0x7f0000000000)=ANY=[@ANYBLOB="12011001000000085f0500a800010000000109022e0001010080320904000004ff00000007050102080000070582030800010705030240000007058402400000"], 0x0)
syz_open_dev$char_usb(0xc, 0xb4, 0x0)
program crashed: possible deadlock in mdc800_device_open
validation run: crashed=true
reproducing took 21m16.745228366s
repro crashed as (corrupted=false):
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/5820 is trying to acquire lock:
ffff888028bb4218 (&mdc800->io_lock){+.+.}-{4:4}, at: mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
but task is already holding lock:
ffffffff8f8f0988 (minor_rwsem#2){++++}-{4:4}, at: usb_open+0x30/0x1e0 drivers/usb/core/file.c:38
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (minor_rwsem#2){++++}-{4:4}:
down_write+0x96/0x200 kernel/locking/rwsem.c:1631
usb_register_dev+0x142/0x5e0 drivers/usb/core/file.c:134
mdc800_usb_probe+0xf96/0x18c0 drivers/usb/image/mdc800.c:485
usb_probe_interface+0x653/0xc60 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:706
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868
driver_probe_device+0x4f/0x240 drivers/base/dd.c:898
__device_attach_driver+0x270/0x410 drivers/base/dd.c:1026
bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500
__device_attach+0x2c4/0x450 drivers/base/dd.c:1098
device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x12a/0x220 drivers/base/bus.c:620
device_add+0x7d7/0xb80 drivers/base/core.c:3776
usb_set_configuration+0x1ad8/0x2180 drivers/usb/core/message.c:2268
usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250
usb_probe_device+0x1c3/0x3b0 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:706
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868
driver_probe_device+0x4f/0x240 drivers/base/dd.c:898
__device_attach_driver+0x270/0x410 drivers/base/dd.c:1026
bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500
__device_attach+0x2c4/0x450 drivers/base/dd.c:1098
device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x12a/0x220 drivers/base/bus.c:620
device_add+0x7d7/0xb80 drivers/base/core.c:3776
usb_new_device+0x9aa/0x1690 drivers/usb/core/hub.c:2703
hub_port_connect drivers/usb/core/hub.c:5575 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
port_event drivers/usb/core/hub.c:5879 [inline]
hub_event+0x28e8/0x4d30 drivers/usb/core/hub.c:5961
process_one_work kernel/workqueue.c:3387 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #0 (&mdc800->io_lock){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3181 [inline]
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821
mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
usb_open+0x156/0x1e0 drivers/usb/core/file.c:47
chrdev_open+0x4d9/0x600 fs/char_dev.c:411
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_compat_sys_openat fs/open.c:1485 [inline]
__se_compat_sys_openat fs/open.c:1483 [inline]
__ia32_compat_sys_openat+0x131/0x160 fs/open.c:1483
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
do_int80_emulation+0x198/0x500 arch/x86/entry/syscall_32.c:166
asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(minor_rwsem#2);
lock(&mdc800->io_lock);
lock(minor_rwsem#2);
lock(&mdc800->io_lock);
*** DEADLOCK ***
locks held by syz.0.17/5820: 1, last CPU#0:
#0: ffffffff8f8f0988 (minor_rwsem#2){++++}-{4:4}, at: usb_open+0x30/0x1e0 drivers/usb/core/file.c:38
stack backtrace:
CPU: 0 UID: 0 PID: 5820 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2059
check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2191
check_prev_add kernel/locking/lockdep.c:3181 [inline]
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821
mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
usb_open+0x156/0x1e0 drivers/usb/core/file.c:47
chrdev_open+0x4d9/0x600 fs/char_dev.c:411
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_compat_sys_openat fs/open.c:1485 [inline]
__se_compat_sys_openat fs/open.c:1483 [inline]
__ia32_compat_sys_openat+0x131/0x160 fs/open.c:1483
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
do_int80_emulation+0x198/0x500 arch/x86/entry/syscall_32.c:166
asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598
RIP: 0023:0xf71a74eb
Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53
RSP: 002b:00000000ffcee49c EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000ffcee560
RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess):
0: 57 push %rdi
1: 56 push %rsi
2: 53 push %rbx
3: 8b 44 24 14 mov 0x14(%rsp),%eax
7: f6 00 08 testb $0x8,(%rax)
a: 75 23 jne 0x2f
c: 8b 44 24 18 mov 0x18(%rsp),%eax
10: 8b 5c 24 1c mov 0x1c(%rsp),%ebx
14: 8b 4c 24 20 mov 0x20(%rsp),%ecx
18: 8b 54 24 24 mov 0x24(%rsp),%edx
1c: 8b 74 24 28 mov 0x28(%rsp),%esi
20: 8b 7c 24 2c mov 0x2c(%rsp),%edi
24: 8b 6c 24 30 mov 0x30(%rsp),%ebp
28: cd 80 int $0x80
* 2a: 5b pop %rbx <-- trapping instruction
2b: 5e pop %rsi
2c: 5f pop %rdi
2d: 5d pop %rbp
2e: c3 ret
2f: 5b pop %rbx
30: 5e pop %rsi
31: 5f pop %rdi
32: 5d pop %rbp
33: e9 f7 a1 ff ff jmp 0xffffa22f
38: 66 90 xchg %ax,%ax
3a: 66 90 xchg %ax,%ax
3c: 66 90 xchg %ax,%ax
3e: 90 nop
3f: 53 push %rbx
final repro crashed as (corrupted=false):
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
raw-gadget.0 gadget.0: fail, usb_ep_enable returned -22
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/5820 is trying to acquire lock:
ffff888028bb4218 (&mdc800->io_lock){+.+.}-{4:4}, at: mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
but task is already holding lock:
ffffffff8f8f0988 (minor_rwsem#2){++++}-{4:4}, at: usb_open+0x30/0x1e0 drivers/usb/core/file.c:38
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (minor_rwsem#2){++++}-{4:4}:
down_write+0x96/0x200 kernel/locking/rwsem.c:1631
usb_register_dev+0x142/0x5e0 drivers/usb/core/file.c:134
mdc800_usb_probe+0xf96/0x18c0 drivers/usb/image/mdc800.c:485
usb_probe_interface+0x653/0xc60 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:706
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868
driver_probe_device+0x4f/0x240 drivers/base/dd.c:898
__device_attach_driver+0x270/0x410 drivers/base/dd.c:1026
bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500
__device_attach+0x2c4/0x450 drivers/base/dd.c:1098
device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x12a/0x220 drivers/base/bus.c:620
device_add+0x7d7/0xb80 drivers/base/core.c:3776
usb_set_configuration+0x1ad8/0x2180 drivers/usb/core/message.c:2268
usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250
usb_probe_device+0x1c3/0x3b0 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:706
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868
driver_probe_device+0x4f/0x240 drivers/base/dd.c:898
__device_attach_driver+0x270/0x410 drivers/base/dd.c:1026
bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500
__device_attach+0x2c4/0x450 drivers/base/dd.c:1098
device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x12a/0x220 drivers/base/bus.c:620
device_add+0x7d7/0xb80 drivers/base/core.c:3776
usb_new_device+0x9aa/0x1690 drivers/usb/core/hub.c:2703
hub_port_connect drivers/usb/core/hub.c:5575 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
port_event drivers/usb/core/hub.c:5879 [inline]
hub_event+0x28e8/0x4d30 drivers/usb/core/hub.c:5961
process_one_work kernel/workqueue.c:3387 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #0 (&mdc800->io_lock){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3181 [inline]
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821
mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
usb_open+0x156/0x1e0 drivers/usb/core/file.c:47
chrdev_open+0x4d9/0x600 fs/char_dev.c:411
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_compat_sys_openat fs/open.c:1485 [inline]
__se_compat_sys_openat fs/open.c:1483 [inline]
__ia32_compat_sys_openat+0x131/0x160 fs/open.c:1483
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
do_int80_emulation+0x198/0x500 arch/x86/entry/syscall_32.c:166
asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(minor_rwsem#2);
lock(&mdc800->io_lock);
lock(minor_rwsem#2);
lock(&mdc800->io_lock);
*** DEADLOCK ***
locks held by syz.0.17/5820: 1, last CPU#0:
#0: ffffffff8f8f0988 (minor_rwsem#2){++++}-{4:4}, at: usb_open+0x30/0x1e0 drivers/usb/core/file.c:38
stack backtrace:
CPU: 0 UID: 0 PID: 5820 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2059
check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2191
check_prev_add kernel/locking/lockdep.c:3181 [inline]
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821
mdc800_device_open+0x2e/0x470 drivers/usb/image/mdc800.c:611
usb_open+0x156/0x1e0 drivers/usb/core/file.c:47
chrdev_open+0x4d9/0x600 fs/char_dev.c:411
do_dentry_open+0x816/0x1380 fs/open.c:996
vfs_open+0x3b/0x340 fs/open.c:1101
do_open fs/namei.c:4837 [inline]
path_openat+0x1443/0x1d60 fs/namei.c:5000
do_file_open+0x23e/0x4a0 fs/namei.c:5029
do_sys_openat2+0x115/0x200 fs/open.c:1417
do_sys_open fs/open.c:1423 [inline]
__do_compat_sys_openat fs/open.c:1485 [inline]
__se_compat_sys_openat fs/open.c:1483 [inline]
__ia32_compat_sys_openat+0x131/0x160 fs/open.c:1483
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
do_int80_emulation+0x198/0x500 arch/x86/entry/syscall_32.c:166
asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598
RIP: 0023:0xf71a74eb
Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53
RSP: 002b:00000000ffcee49c EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000ffcee560
RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess):
0: 57 push %rdi
1: 56 push %rsi
2: 53 push %rbx
3: 8b 44 24 14 mov 0x14(%rsp),%eax
7: f6 00 08 testb $0x8,(%rax)
a: 75 23 jne 0x2f
c: 8b 44 24 18 mov 0x18(%rsp),%eax
10: 8b 5c 24 1c mov 0x1c(%rsp),%ebx
14: 8b 4c 24 20 mov 0x20(%rsp),%ecx
18: 8b 54 24 24 mov 0x24(%rsp),%edx
1c: 8b 74 24 28 mov 0x28(%rsp),%esi
20: 8b 7c 24 2c mov 0x2c(%rsp),%edi
24: 8b 6c 24 30 mov 0x30(%rsp),%ebp
28: cd 80 int $0x80
* 2a: 5b pop %rbx <-- trapping instruction
2b: 5e pop %rsi
2c: 5f pop %rdi
2d: 5d pop %rbp
2e: c3 ret
2f: 5b pop %rbx
30: 5e pop %rsi
31: 5f pop %rdi
32: 5d pop %rbp
33: e9 f7 a1 ff ff jmp 0xffffa22f
38: 66 90 xchg %ax,%ax
3a: 66 90 xchg %ax,%ax
3c: 66 90 xchg %ax,%ax
3e: 90 nop
3f: 53 push %rbx