====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc1-syzkaller-00025-gfeffde684ac2 #0 Not tainted ------------------------------------------------------ syz.2.664/8461 is trying to acquire lock: ffff8880001d92c0 (&dev->mutex#2){+.+.}-{4:4}, at: input_disconnect_device drivers/input/input.c:729 [inline] ffff8880001d92c0 (&dev->mutex#2){+.+.}-{4:4}, at: __input_unregister_device+0x24/0x450 drivers/input/input.c:2275 but task is already holding lock: ffff888070cfde20 (&hdev->ll_open_lock){+.+.}-{4:4}, at: hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2392 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&hdev->ll_open_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2392 input_open_device+0x22c/0x390 drivers/input/input.c:620 evdev_open_device drivers/input/evdev.c:391 [inline] evdev_open+0x52d/0x690 drivers/input/evdev.c:478 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0xf59/0x1ea0 fs/open.c:945 vfs_open+0x82/0x3f0 fs/open.c:1075 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&dev->mutex#2){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 input_disconnect_device drivers/input/input.c:729 [inline] __input_unregister_device+0x24/0x450 drivers/input/input.c:2275 input_unregister_device+0xb9/0x100 drivers/input/input.c:2516 steam_input_unregister+0x10c/0x2c0 drivers/hid/hid-steam.c:917 steam_client_ll_open+0xc9/0x100 drivers/hid/hid-steam.c:1121 hid_hw_open+0xe2/0x170 drivers/hid/hid-core.c:2397 hidraw_open+0x274/0x7e0 drivers/hid/hidraw.c:308 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0xf59/0x1ea0 fs/open.c:945 vfs_open+0x82/0x3f0 fs/open.c:1075 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_compat_sys_openat fs/open.c:1479 [inline] __se_compat_sys_openat fs/open.c:1477 [inline] __ia32_compat_sys_openat+0x16e/0x210 fs/open.c:1477 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&hdev->ll_open_lock); lock(&dev->mutex#2); lock(&hdev->ll_open_lock); lock(&dev->mutex#2); *** DEADLOCK *** 2 locks held by syz.2.664/8461: #0: ffffffff8f821cd0 (minors_rwsem){+.+.}-{4:4}, at: hidraw_open+0xa6/0x7e0 drivers/hid/hidraw.c:294 #1: ffff888070cfde20 (&hdev->ll_open_lock){+.+.}-{4:4}, at: hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2392 stack backtrace: CPU: 0 UID: 0 PID: 8461 Comm: syz.2.664 Not tainted 6.13.0-rc1-syzkaller-00025-gfeffde684ac2 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x41c/0x610 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 input_disconnect_device drivers/input/input.c:729 [inline] __input_unregister_device+0x24/0x450 drivers/input/input.c:2275 input_unregister_device+0xb9/0x100 drivers/input/input.c:2516 steam_input_unregister+0x10c/0x2c0 drivers/hid/hid-steam.c:917 steam_client_ll_open+0xc9/0x100 drivers/hid/hid-steam.c:1121 hid_hw_open+0xe2/0x170 drivers/hid/hid-core.c:2397 hidraw_open+0x274/0x7e0 drivers/hid/hidraw.c:308 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0xf59/0x1ea0 fs/open.c:945 vfs_open+0x82/0x3f0 fs/open.c:1075 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_compat_sys_openat fs/open.c:1479 [inline] __se_compat_sys_openat fs/open.c:1477 [inline] __ia32_compat_sys_openat+0x16e/0x210 fs/open.c:1477 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f13579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5075120 EFLAGS: 00000293 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000f5075170 RDX: 000000000014a042 RSI: 0000000000000000 RDI: 00000000f739fff4 RBP: 000000000014a042 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 input: Steam Controller as /devices/platform/dummy_hcd.1/usb6/6-1/6-1:0.0/0003:28DE:1102.0002/input/input12 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi