syzbot


possible deadlock in hid_hw_open

Status: upstream: reported on 2025/11/17 00:02
Reported-by: syzbot+5b561352f6fb49fc5a88@syzkaller.appspotmail.com
First crash: 4d17h, last: 3d20h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in hid_hw_open (2) 4 1 121d 121d 0/3 auto-obsoleted due to no activity on 2025/10/31 06:50
linux-5.15 possible deadlock in hid_hw_open 4 1 229d 229d 0/3 auto-obsoleted due to no activity on 2025/07/15 00:10
upstream possible deadlock in hid_hw_open input 4 73 290d 460d 0/29 auto-obsoleted due to no activity on 2025/04/15 13:39

Sample crash report:
input: HID 045e:07da as /devices/platform/dummy_hcd.0/usb1/1-1/1-1:0.0/0003:045E:07DA.0017/input/input17
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/1:18/5326 is trying to acquire lock:
ffff88805de25e18 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2347

but task is already holding lock:
ffff88805491b2c0 (&dev->mutex#2){+.+.}-{3:3}, at: input_open_device+0x4e/0x2e0 drivers/input/input.c:630

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&dev->mutex#2){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
       input_disconnect_device drivers/input/input.c:757 [inline]
       __input_unregister_device+0x31/0x5f0 drivers/input/input.c:2291
       input_unregister_device+0x97/0xf0 drivers/input/input.c:2514
       steam_client_ll_open+0x73/0x90 drivers/hid/hid-steam.c:640
       hid_hw_open+0xdd/0x160 drivers/hid/hid-core.c:2352
       hidraw_open+0x28d/0x8a0 drivers/hid/hidraw.c:294
       chrdev_open+0x597/0x670 fs/char_dev.c:414
       do_dentry_open+0x7e9/0x10d0 fs/open.c:882
       do_open fs/namei.c:3634 [inline]
       path_openat+0x25c6/0x2e70 fs/namei.c:3791
       do_filp_open+0x1c1/0x3c0 fs/namei.c:3818
       do_sys_openat2+0x142/0x490 fs/open.c:1318
       do_sys_open fs/open.c:1334 [inline]
       __do_sys_openat fs/open.c:1350 [inline]
       __se_sys_openat fs/open.c:1345 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1345
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&hdev->ll_open_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain kernel/locking/lockdep.c:3825 [inline]
       __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
       lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
       hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2347
       input_open_device+0x16c/0x2e0 drivers/input/input.c:650
       kbd_connect+0xe9/0x130 drivers/tty/vt/keyboard.c:1593
       input_attach_handler drivers/input/input.c:1060 [inline]
       input_register_device+0xdfd/0x1310 drivers/input/input.c:2470
       hidinput_connect+0x25cb/0x2f20 drivers/hid/hid-input.c:2334
       hid_connect+0x496/0x1940 drivers/hid/hid-core.c:2197
       hid_hw_start+0x99/0x100 drivers/hid/hid-core.c:2310
       ms_probe+0x179/0x420 drivers/hid/hid-microsoft.c:391
       hid_device_probe+0x25c/0x350 drivers/hid/hid-core.c:2641
       call_driver_probe drivers/base/dd.c:-1 [inline]
       really_probe+0x2aa/0xc70 drivers/base/dd.c:639
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
       __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:1015
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3697
       hid_add_device+0x389/0x530 drivers/hid/hid-core.c:2793
       usbhid_probe+0xc09/0xfe0 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+0x2aa/0xc70 drivers/base/dd.c:639
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
       __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:1015
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3697
       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+0x2aa/0xc70 drivers/base/dd.c:639
       __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
       driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
       __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
       bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
       __device_attach+0x29b/0x460 drivers/base/dd.c:1015
       bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
       device_add+0xa00/0xfb0 drivers/base/core.c:3697
       usb_new_device+0xd4d/0x1620 drivers/usb/core/hub.c:2659
       hub_port_connect drivers/usb/core/hub.c:5517 [inline]
       hub_port_connect_change drivers/usb/core/hub.c:5657 [inline]
       port_event drivers/usb/core/hub.c:5817 [inline]
       hub_event+0x2d5e/0x54e0 drivers/usb/core/hub.c:5899
       process_one_work+0x898/0x1160 kernel/workqueue.c:2292
       worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&dev->mutex#2);
                               lock(&hdev->ll_open_lock);
                               lock(&dev->mutex#2);
  lock(&hdev->ll_open_lock);

 *** DEADLOCK ***

8 locks held by kworker/1:18/5326:
 #0: ffff888143a96938 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x7a1/0x1160 kernel/workqueue.c:2267
 #1: ffffc900048e7d00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x7a1/0x1160 kernel/workqueue.c:2267
 #2: ffff888145b7a190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:840 [inline]
 #2: ffff888145b7a190 (&dev->mutex){....}-{3:3}, at: hub_event+0x1a7/0x54e0 drivers/usb/core/hub.c:5845
 #3: ffff888058041190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:840 [inline]
 #3: ffff888058041190 (&dev->mutex){....}-{3:3}, at: __device_attach+0x85/0x460 drivers/base/dd.c:990
 #4: ffff888141bd6118 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:840 [inline]
 #4: ffff888141bd6118 (&dev->mutex){....}-{3:3}, at: __device_attach+0x85/0x460 drivers/base/dd.c:990
 #5: ffff88805de25a20 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:840 [inline]
 #5: ffff88805de25a20 (&dev->mutex){....}-{3:3}, at: __device_attach+0x85/0x460 drivers/base/dd.c:990
 #6: ffffffff8d828148 (input_mutex){+.+.}-{3:3}, at: input_register_device+0xbc6/0x1310 drivers/input/input.c:2463
 #7: ffff88805491b2c0 (&dev->mutex#2){+.+.}-{3:3}, at: input_open_device+0x4e/0x2e0 drivers/input/input.c:630

stack backtrace:
CPU: 1 PID: 5326 Comm: kworker/1:18 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain kernel/locking/lockdep.c:3825 [inline]
 __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
 hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2347
 input_open_device+0x16c/0x2e0 drivers/input/input.c:650
 kbd_connect+0xe9/0x130 drivers/tty/vt/keyboard.c:1593
 input_attach_handler drivers/input/input.c:1060 [inline]
 input_register_device+0xdfd/0x1310 drivers/input/input.c:2470
 hidinput_connect+0x25cb/0x2f20 drivers/hid/hid-input.c:2334
 hid_connect+0x496/0x1940 drivers/hid/hid-core.c:2197
 hid_hw_start+0x99/0x100 drivers/hid/hid-core.c:2310
 ms_probe+0x179/0x420 drivers/hid/hid-microsoft.c:391
 hid_device_probe+0x25c/0x350 drivers/hid/hid-core.c:2641
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x2aa/0xc70 drivers/base/dd.c:639
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:1015
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3697
 hid_add_device+0x389/0x530 drivers/hid/hid-core.c:2793
 usbhid_probe+0xc09/0xfe0 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+0x2aa/0xc70 drivers/base/dd.c:639
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:1015
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3697
 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+0x2aa/0xc70 drivers/base/dd.c:639
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:1015
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3697
 usb_new_device+0xd4d/0x1620 drivers/usb/core/hub.c:2659
 hub_port_connect drivers/usb/core/hub.c:5517 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5657 [inline]
 port_event drivers/usb/core/hub.c:5817 [inline]
 hub_event+0x2d5e/0x54e0 drivers/usb/core/hub.c:5899
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
microsoft 0003:045E:07DA.0017: input,hidraw0: USB HID v0.00 Device [HID 045e:07da] on usb-dummy_hcd.0-1/input0
usb 1-1: USB disconnect, device number 10

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/17 21:13 linux-6.1.y f6e38ae624cf ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hid_hw_open
2025/11/17 21:12 linux-6.1.y f6e38ae624cf ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hid_hw_open
2025/11/17 00:02 linux-6.1.y f6e38ae624cf f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hid_hw_open
* Struck through repros no longer work on HEAD.