====================================================== WARNING: possible circular locking dependency detected 5.11.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/5898 is trying to acquire lock: ffffffff8b7c4f88 (driver_lock){+.+.}-{3:3}, at: display_open+0x1e/0x1e0 drivers/media/rc/imon.c:503 but task is already holding lock: ffffffff8b5365d0 (minor_rwsem#2){++++}-{3:3}, at: usb_open+0x1f/0x2a0 drivers/usb/core/file.c:39 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (minor_rwsem#2){++++}-{3:3}: down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 usb_register_dev drivers/usb/core/file.c:187 [inline] usb_register_dev+0x12e/0x700 drivers/usb/core/file.c:156 imon_init_display drivers/media/rc/imon.c:2388 [inline] imon_probe+0x2218/0x2990 drivers/media/rc/imon.c:2471 usb_probe_interface+0x274/0x6a0 drivers/usb/core/driver.c:396 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x99a/0x1ad0 drivers/base/core.c:3109 usb_set_configuration+0x9f9/0x1750 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0x74/0xa0 drivers/usb/core/generic.c:238 usb_probe_device+0x98/0x240 drivers/usb/core/driver.c:293 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x99a/0x1ad0 drivers/base/core.c:3109 usb_new_device.cold+0x69a/0xee1 drivers/usb/core/hub.c:2555 hub_port_connect drivers/usb/core/hub.c:5223 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0x10a3/0x36b0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 -> #1 (&ictx->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x1110 kernel/locking/mutex.c:1103 imon_init_intf0 drivers/media/rc/imon.c:2233 [inline] imon_probe+0xec9/0x2990 drivers/media/rc/imon.c:2432 usb_probe_interface+0x274/0x6a0 drivers/usb/core/driver.c:396 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x99a/0x1ad0 drivers/base/core.c:3109 usb_set_configuration+0x9f9/0x1750 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0x74/0xa0 drivers/usb/core/generic.c:238 usb_probe_device+0x98/0x240 drivers/usb/core/driver.c:293 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x99a/0x1ad0 drivers/base/core.c:3109 usb_new_device.cold+0x69a/0xee1 drivers/usb/core/hub.c:2555 hub_port_connect drivers/usb/core/hub.c:5223 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0x10a3/0x36b0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 -> #0 (driver_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2b3b/0x57d0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x1110 kernel/locking/mutex.c:1103 display_open+0x1e/0x1e0 drivers/media/rc/imon.c:503 usb_open+0x1d5/0x2a0 drivers/usb/core/file.c:48 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x42a/0xfb0 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x129c/0x2190 fs/namei.c:3371 do_filp_open+0x16d/0x390 fs/namei.c:3398 do_sys_openat2+0x11e/0x360 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_openat fs/open.c:1204 [inline] __se_sys_openat fs/open.c:1199 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1199 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: driver_lock --> &ictx->lock --> minor_rwsem#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(minor_rwsem#2); lock(&ictx->lock); lock(minor_rwsem#2); lock(driver_lock); *** DEADLOCK *** 1 lock held by syz-executor.0/5898: #0: ffffffff8b5365d0 (minor_rwsem#2){++++}-{3:3}, at: usb_open+0x1f/0x2a0 drivers/usb/core/file.c:39 stack backtrace: CPU: 0 PID: 5898 Comm: syz-executor.0 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/18/2022 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2117 check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2b3b/0x57d0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x1110 kernel/locking/mutex.c:1103 display_open+0x1e/0x1e0 drivers/media/rc/imon.c:503 usb_open+0x1d5/0x2a0 drivers/usb/core/file.c:48 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x42a/0xfb0 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x129c/0x2190 fs/namei.c:3371 do_filp_open+0x16d/0x390 fs/namei.c:3398 do_sys_openat2+0x11e/0x360 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_openat fs/open.c:1204 [inline] __se_sys_openat fs/open.c:1199 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1199 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fa8a9a3d024 Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 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 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44 RSP: 002b:00007fa8a91feca0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fa8a9b9cf60 RCX: 00007fa8a9a3d024 RDX: 0000000000000002 RSI: 00007fa8a91fed40 RDI: 00000000ffffff9c RBP: 00007fa8a91fed40 R08: 0000000000000000 R09: 000000000000000f R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002 R13: 00007ffe3f1cf11f R14: 00007fa8a91ff300 R15: 0000000000022000 imon:send_packet: task interrupted imon:send_packet: packet tx failed (-2) imon:vfd_write: send packet #0 failed