keytouch 0003:0926:3333.0006: fixing up Keytouch IEC report descriptor input: HID 0926:3333 as /devices/platform/dummy_hcd.2/usb3/3-1/3-1:0.0/0003:0926:3333.0006/input/input11 ====================================================== WARNING: possible circular locking dependency detected 6.13.0-syzkaller-09485-g72deda0abee6 #0 Not tainted ------------------------------------------------------ kworker/0:4/5232 is trying to acquire lock: ffff8881318e1e18 (&hdev->ll_open_lock){+.+.}-{4:4}, at: hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2387 but task is already holding lock: ffff888131b5c2c0 (&dev->mutex#2){+.+.}-{4:4}, at: class_mutex_intr_constructor include/linux/mutex.h:203 [inline] ffff888131b5c2c0 (&dev->mutex#2){+.+.}-{4:4}, at: input_open_device+0x5c/0x390 drivers/input/input.c:582 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&dev->mutex#2){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730 class_mutex_constructor include/linux/mutex.h:201 [inline] input_disconnect_device drivers/input/input.c:702 [inline] __input_unregister_device+0x24/0x470 drivers/input/input.c:2219 input_unregister_device+0xb9/0x100 drivers/input/input.c:2452 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:2392 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:955 vfs_open+0x82/0x3f0 fs/open.c:1085 do_open fs/namei.c:3828 [inline] path_openat+0x1e88/0x2d80 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1427 do_sys_open fs/open.c:1442 [inline] __do_sys_openat fs/open.c:1458 [inline] __se_sys_openat fs/open.c:1453 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1453 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 (&hdev->ll_open_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730 hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2387 input_open_device+0x230/0x390 drivers/input/input.c:600 kbd_connect+0x103/0x160 drivers/tty/vt/keyboard.c:1591 input_attach_handler.isra.0+0x181/0x260 drivers/input/input.c:993 input_register_device+0xa84/0x1130 drivers/input/input.c:2412 hidinput_connect+0x1da5/0x2ba0 drivers/hid/hid-input.c:2340 hid_connect+0x1393/0x1890 drivers/hid/hid-core.c:2235 hid_hw_start drivers/hid/hid-core.c:2350 [inline] hid_hw_start+0xaa/0x140 drivers/hid/hid-core.c:2341 __hid_device_probe drivers/hid/hid-core.c:2717 [inline] hid_device_probe+0x5f1/0x700 drivers/hid/hid-core.c:2750 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 hid_add_device+0x374/0xa60 drivers/hid/hid-core.c:2896 usbhid_probe+0xd32/0x1400 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_new_device+0xd09/0x1a20 drivers/usb/core/hub.c:2652 hub_port_connect drivers/usb/core/hub.c:5523 [inline] hub_port_connect_change drivers/usb/core/hub.c:5663 [inline] port_event drivers/usb/core/hub.c:5823 [inline] hub_event+0x2e58/0x4f40 drivers/usb/core/hub.c:5905 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3317 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 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/0:4/5232: #0: ffff8881066e8d48 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x1293/0x1ba0 kernel/workqueue.c:3211 #1: ffffc9000212fd18 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x921/0x1ba0 kernel/workqueue.c:3212 #2: ffff88810b381190 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1030 [inline] #2: ffff88810b381190 (&dev->mutex){....}-{4:4}, at: hub_event+0x1be/0x4f40 drivers/usb/core/hub.c:5851 #3: ffff888117d4e190 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1030 [inline] #3: ffff888117d4e190 (&dev->mutex){....}-{4:4}, at: __device_attach+0x7f/0x4b0 drivers/base/dd.c:1005 #4: ffff8881000a5160 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1030 [inline] #4: ffff8881000a5160 (&dev->mutex){....}-{4:4}, at: __device_attach+0x7f/0x4b0 drivers/base/dd.c:1005 #5: ffff8881318e1a20 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1030 [inline] #5: ffff8881318e1a20 (&dev->mutex){....}-{4:4}, at: __device_attach+0x7f/0x4b0 drivers/base/dd.c:1005 #6: ffffffff89be63a8 (input_mutex){+.+.}-{4:4}, at: class_mutex_intr_constructor include/linux/mutex.h:203 [inline] #6: ffffffff89be63a8 (input_mutex){+.+.}-{4:4}, at: input_register_device+0x98a/0x1130 drivers/input/input.c:2408 #7: ffff888131b5c2c0 (&dev->mutex#2){+.+.}-{4:4}, at: class_mutex_intr_constructor include/linux/mutex.h:203 [inline] #7: ffff888131b5c2c0 (&dev->mutex#2){+.+.}-{4:4}, at: input_open_device+0x5c/0x390 drivers/input/input.c:582 stack backtrace: CPU: 0 UID: 0 PID: 5232 Comm: kworker/0:4 Not tainted 6.13.0-syzkaller-09485-g72deda0abee6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x490/0x760 kernel/locking/lockdep.c:2076 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730 hid_hw_open+0x25/0x170 drivers/hid/hid-core.c:2387 input_open_device+0x230/0x390 drivers/input/input.c:600 kbd_connect+0x103/0x160 drivers/tty/vt/keyboard.c:1591 input_attach_handler.isra.0+0x181/0x260 drivers/input/input.c:993 input_register_device+0xa84/0x1130 drivers/input/input.c:2412 hidinput_connect+0x1da5/0x2ba0 drivers/hid/hid-input.c:2340 hid_connect+0x1393/0x1890 drivers/hid/hid-core.c:2235 hid_hw_start drivers/hid/hid-core.c:2350 [inline] hid_hw_start+0xaa/0x140 drivers/hid/hid-core.c:2341 __hid_device_probe drivers/hid/hid-core.c:2717 [inline] hid_device_probe+0x5f1/0x700 drivers/hid/hid-core.c:2750 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 hid_add_device+0x374/0xa60 drivers/hid/hid-core.c:2896 usbhid_probe+0xd32/0x1400 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250 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:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_new_device+0xd09/0x1a20 drivers/usb/core/hub.c:2652 hub_port_connect drivers/usb/core/hub.c:5523 [inline] hub_port_connect_change drivers/usb/core/hub.c:5663 [inline] port_event drivers/usb/core/hub.c:5823 [inline] hub_event+0x2e58/0x4f40 drivers/usb/core/hub.c:5905 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3317 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 keytouch 0003:0926:3333.0006: input,hidraw0: USB HID v0.00 Keyboard [HID 0926:3333] on usb-dummy_hcd.2-1/input0 usb 3-1: USB disconnect, device number 12 usb 5-1: USB disconnect, device number 7