====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc6-syzkaller-00153-g237d4e0f4113 #0 Not tainted ------------------------------------------------------ syz.4.1022/10518 is trying to acquire lock: ffff88810ff7f2c0 (&dev->mutex#2){+.+.}-{3:3}, at: input_disconnect_device drivers/input/input.c:724 [inline] (&dev->mutex#2){+.+.}-{3:3}, at: __input_unregister_device+0x24/0x450 drivers/input/input.c:2270 but task is already holding lock: ffff888134e95e18 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2386 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 kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2386 input_open_device+0x1c9/0x320 drivers/input/input.c:617 kbd_connect+0x103/0x160 drivers/tty/vt/keyboard.c:1591 input_attach_handler.isra.0+0x181/0x260 drivers/input/input.c:1027 input_register_device+0xa84/0x1110 drivers/input/input.c:2470 hidinput_connect+0x1d9c/0x2ba0 drivers/hid/hid-input.c:2343 hid_connect+0x13a8/0x18a0 drivers/hid/hid-core.c:2234 hid_hw_start drivers/hid/hid-core.c:2349 [inline] hid_hw_start+0xaa/0x140 drivers/hid/hid-core.c:2340 __hid_device_probe drivers/hid/hid-core.c:2703 [inline] hid_device_probe+0x3e7/0x490 drivers/hid/hid-core.c:2736 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:459 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534 device_add+0x114b/0x1a70 drivers/base/core.c:3672 hid_add_device+0x37f/0xa70 drivers/hid/hid-core.c:2882 usbhid_probe+0xd3b/0x1410 drivers/hid/usbhid/hid-core.c:1431 usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:459 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534 device_add+0x114b/0x1a70 drivers/base/core.c:3672 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:254 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:459 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534 device_add+0x114b/0x1a70 drivers/base/core.c:3672 usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2651 hub_port_connect drivers/usb/core/hub.c:5521 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2e58/0x4f40 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (&dev->mutex#2){+.+.}-{3:3}: 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+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 input_disconnect_device drivers/input/input.c:724 [inline] __input_unregister_device+0x24/0x450 drivers/input/input.c:2270 input_unregister_device+0xb9/0x100 drivers/input/input.c:2511 steam_sensors_unregister.part.0+0x10c/0x2c0 drivers/hid/hid-steam.c:935 steam_sensors_unregister drivers/hid/hid-steam.c:924 [inline] steam_client_ll_open+0xbc/0x100 drivers/hid/hid-steam.c:1120 hid_hw_open+0xe2/0x170 drivers/hid/hid-core.c:2391 hidraw_open+0x274/0x7e0 drivers/hid/hidraw.c:308 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0x6cb/0x1390 fs/open.c:958 vfs_open+0x82/0x3f0 fs/open.c:1088 do_open fs/namei.c:3774 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3933 do_filp_open+0x1dc/0x430 fs/namei.c:3960 do_sys_openat2+0x17a/0x1e0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1441 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 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.4.1022/10518: #0: ffffffff89f65e50 (minors_rwsem){+.+.}-{3:3}, at: hidraw_open+0xa6/0x7e0 drivers/hid/hidraw.c:294 #1: ffff888134e95e18 (&hdev->ll_open_lock ){+.+.}-{3:3}, at: hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2386 stack backtrace: CPU: 1 UID: 0 PID: 10518 Comm: syz.4.1022 Not tainted 6.12.0-rc6-syzkaller-00153-g237d4e0f4113 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 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+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 input_disconnect_device drivers/input/input.c:724 [inline] __input_unregister_device+0x24/0x450 drivers/input/input.c:2270 input_unregister_device+0xb9/0x100 drivers/input/input.c:2511 steam_sensors_unregister.part.0+0x10c/0x2c0 drivers/hid/hid-steam.c:935 steam_sensors_unregister drivers/hid/hid-steam.c:924 [inline] steam_client_ll_open+0xbc/0x100 drivers/hid/hid-steam.c:1120 hid_hw_open+0xe2/0x170 drivers/hid/hid-core.c:2391 hidraw_open+0x274/0x7e0 drivers/hid/hidraw.c:308 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0x6cb/0x1390 fs/open.c:958 vfs_open+0x82/0x3f0 fs/open.c:1088 do_open fs/namei.c:3774 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3933 do_filp_open+0x1dc/0x430 fs/namei.c:3960 do_sys_openat2+0x17a/0x1e0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1441 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 RIP: 0033:0x7f9c0a0df1b0 Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 49 8f 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 9c 8f 02 00 8b 44 RSP: 002b:00007f9c08756b90 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9c0a0df1b0 RDX: 0000000000000000 RSI: 00007f9c08756c30 RDI: 00000000ffffff9c RBP: 00007f9c08756c30 R08: 0000000000000000 R09: 0023776172646968 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9c0a2a5fa0 R15: 00007ffc1cd52808 input: Steam Deck as /devices/platform/dummy_hcd.4/usb5/5-1/5-1:0.0/0003:28DE:1205.0092/input/input106 input: Steam Deck Motion Sensors as /devices/platform/dummy_hcd.4/usb5/5-1/5-1:0.0/0003:28DE:1205.0092/input/input107