syzbot


possible deadlock in __input_unregister_device (2)

Status: upstream: reported on 2025/12/28 07:37
Reported-by: syzbot+ad75b408141218daacdd@syzkaller.appspotmail.com
First crash: 17d, last: 11d
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in __input_unregister_device 4 2 249d 314d 0/3 auto-obsoleted due to no activity on 2025/08/18 04:46
linux-6.1 possible deadlock in __input_unregister_device 4 1 314d 314d 0/3 auto-obsoleted due to no activity on 2025/06/14 09:26
upstream possible deadlock in __input_unregister_device input 4 289 331d 521d 0/29 auto-obsoleted due to no activity on 2025/04/28 01:51

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.35/4489 is trying to acquire lock:
ffff8880253ee2c0 (&dev->mutex#2){+.+.}-{3:3}, at: input_disconnect_device drivers/input/input.c:748 [inline]
ffff8880253ee2c0 (&dev->mutex#2){+.+.}-{3:3}, at: __input_unregister_device+0x2e/0x320 drivers/input/input.c:2278

but task is already holding lock:
ffff88805aa71ee0 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2127

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&hdev->ll_open_lock){+.+.}-{3:3}:
       __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
       hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2127
       input_open_device+0x16c/0x2e0 drivers/input/input.c:640
       kbd_connect+0xe9/0x130 drivers/tty/vt/keyboard.c:1581
       input_attach_handler drivers/input/input.c:1046 [inline]
       input_register_device+0xda7/0x1140 drivers/input/input.c:2429
       hidinput_connect+0x2440/0x2d90 drivers/hid/hid-input.c:2030
       hid_connect+0x458/0xdf0 drivers/hid/hid-core.c:1983
       hid_hw_start+0x99/0x100 drivers/hid/hid-core.c:2090
       ms_probe+0x179/0x420 drivers/hid/hid-microsoft.c:391
       hid_device_probe+0x271/0x360 drivers/hid/hid-core.c:2318
       call_driver_probe drivers/base/dd.c:-1 [inline]
       really_probe+0x284/0xc80 drivers/base/dd.c:595
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
       __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:979
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3412
       hid_add_device+0x389/0x530 drivers/hid/hid-core.c:2470
       usbhid_probe+0xb92/0xf40 drivers/hid/usbhid/hid-core.c:1427
       usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396
       call_driver_probe drivers/base/dd.c:-1 [inline]
       really_probe+0x284/0xc80 drivers/base/dd.c:595
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
       __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:979
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3412
       usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2165
       usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
       usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293
       call_driver_probe drivers/base/dd.c:-1 [inline]
       really_probe+0x284/0xc80 drivers/base/dd.c:595
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
       __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:979
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3412
       usb_new_device+0xd53/0x1640 drivers/usb/core/hub.c:2632
       hub_port_connect drivers/usb/core/hub.c:5497 [inline]
       hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
       port_event drivers/usb/core/hub.c:5799 [inline]
       hub_event+0x2dd9/0x5560 drivers/usb/core/hub.c:5881
       process_one_work+0x863/0x1000 kernel/workqueue.c:2310
       worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
       kthread+0x436/0x520 kernel/kthread.c:334
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 (&dev->mutex#2){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
       lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       input_disconnect_device drivers/input/input.c:748 [inline]
       __input_unregister_device+0x2e/0x320 drivers/input/input.c:2278
       input_unregister_device+0x97/0xf0 drivers/input/input.c:2473
       steam_client_ll_open+0x73/0x90 drivers/hid/hid-steam.c:640
       hid_hw_open+0xdd/0x160 drivers/hid/hid-core.c:2132
       hidraw_open+0x28f/0x8b0 drivers/hid/hidraw.c:289
       chrdev_open+0x597/0x670 fs/char_dev.c:414
       do_dentry_open+0x7ff/0xf80 fs/open.c:826
       do_open fs/namei.c:3616 [inline]
       path_openat+0x2682/0x2f30 fs/namei.c:3750
       do_filp_open+0x1b3/0x3e0 fs/namei.c:3777
       do_sys_openat2+0x142/0x4a0 fs/open.c:1255
       do_sys_open fs/open.c:1271 [inline]
       __do_sys_openat fs/open.c:1287 [inline]
       __se_sys_openat fs/open.c:1282 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1282
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

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.1.35/4489:
 #0: ffffffff8d0aeb08 (minors_lock){+.+.}-{3:3}, at: hidraw_open+0x91/0x8b0 drivers/hid/hidraw.c:275
 #1: ffff88805aa71ee0 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2127

stack backtrace:
CPU: 0 PID: 4489 Comm: syz.1.35 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 input_disconnect_device drivers/input/input.c:748 [inline]
 __input_unregister_device+0x2e/0x320 drivers/input/input.c:2278
 input_unregister_device+0x97/0xf0 drivers/input/input.c:2473
 steam_client_ll_open+0x73/0x90 drivers/hid/hid-steam.c:640
 hid_hw_open+0xdd/0x160 drivers/hid/hid-core.c:2132
 hidraw_open+0x28f/0x8b0 drivers/hid/hidraw.c:289
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7ff/0xf80 fs/open.c:826
 do_open fs/namei.c:3616 [inline]
 path_openat+0x2682/0x2f30 fs/namei.c:3750
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3777
 do_sys_openat2+0x142/0x4a0 fs/open.c:1255
 do_sys_open fs/open.c:1271 [inline]
 __do_sys_openat fs/open.c:1287 [inline]
 __se_sys_openat fs/open.c:1282 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1282
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fc6aa4f6f90
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 69 95 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 bc 95 02 00 8b 44
RSP: 002b:00007fc6a873db70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 000000000014a002 RCX: 00007fc6aa4f6f90
RDX: 000000000014a002 RSI: 00007fc6a873dc10 RDI: 00000000ffffff9c
RBP: 00007fc6a873dc10 R08: 0000000000000000 R09: 0023776172646968
R10: 0000000000000000 R11: 0000000000000293 R12: cccccccccccccccd
R13: 00007fc6aa74f128 R14: 00007fc6aa74f090 R15: 00007ffcac2ee6f8
 </TASK>
input: Steam Controller as /devices/platform/dummy_hcd.1/usb2/2-1/2-1:0.0/0003:28DE:1102.0001/input/input9

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/03 17:34 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in __input_unregister_device
2026/01/02 04:54 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in __input_unregister_device
2025/12/29 08:16 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in __input_unregister_device
2025/12/28 07:44 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in __input_unregister_device
2025/12/28 07:36 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in __input_unregister_device
* Struck through repros no longer work on HEAD.