====================================================== WARNING: possible circular locking dependency detected 5.11.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/16417 is trying to acquire lock: ffffffff87fa66a8 (driver_lock){+.+.}-{3:3}, at: display_open+0x1f/0x220 drivers/media/rc/imon.c:503 but task is already holding lock: ffffffff87d43650 (minor_rwsem){++++}-{3:3}, at: usb_open+0x24/0x2e0 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){++++}-{3:3}: down_write+0x92/0x150 kernel/locking/rwsem.c:1406 usb_register_dev drivers/usb/core/file.c:187 [inline] usb_register_dev+0x19d/0x7e0 drivers/usb/core/file.c:156 imon_init_display drivers/media/rc/imon.c:2386 [inline] imon_probe+0x24c6/0x2b60 drivers/media/rc/imon.c:2471 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 really_probe+0x291/0xde0 drivers/base/dd.c:561 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:745 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:851 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:919 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbc4/0x1d90 drivers/base/core.c:3091 usb_set_configuration+0x113c/0x1910 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293 really_probe+0x291/0xde0 drivers/base/dd.c:561 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:745 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:851 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:919 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbc4/0x1d90 drivers/base/core.c:3091 usb_new_device.cold+0x725/0x1057 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+0x2348/0x42d0 drivers/usb/core/hub.c:5591 process_one_work+0x98d/0x1580 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x38c/0x460 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/0x10e0 kernel/locking/mutex.c:1103 imon_init_intf0 drivers/media/rc/imon.c:2233 [inline] imon_probe+0xfbf/0x2b60 drivers/media/rc/imon.c:2432 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 really_probe+0x291/0xde0 drivers/base/dd.c:561 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:745 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:851 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:919 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbc4/0x1d90 drivers/base/core.c:3091 usb_set_configuration+0x113c/0x1910 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293 really_probe+0x291/0xde0 drivers/base/dd.c:561 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:745 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:851 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431 __device_attach+0x228/0x4a0 drivers/base/dd.c:919 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491 device_add+0xbc4/0x1d90 drivers/base/core.c:3091 usb_new_device.cold+0x725/0x1057 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+0x2348/0x42d0 drivers/usb/core/hub.c:5591 process_one_work+0x98d/0x1580 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x38c/0x460 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+0x2b1a/0x54f0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x288/0x700 kernel/locking/lockdep.c:5402 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103 display_open+0x1f/0x220 drivers/media/rc/imon.c:503 usb_open+0x204/0x2e0 drivers/usb/core/file.c:48 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b4/0x1090 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3371 do_filp_open+0x17e/0x3c0 fs/namei.c:3398 do_sys_openat2+0x16d/0x420 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1192 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 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(minor_rwsem); lock(&ictx->lock); lock(minor_rwsem); lock(driver_lock); *** DEADLOCK *** 1 lock held by syz-executor.4/16417: #0: ffffffff87d43650 (minor_rwsem){++++}-{3:3}, at: usb_open+0x24/0x2e0 drivers/usb/core/file.c:39 stack backtrace: CPU: 0 PID: 16417 Comm: syz-executor.4 Not tainted 5.11.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 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+0x2b1a/0x54f0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x288/0x700 kernel/locking/lockdep.c:5402 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103 display_open+0x1f/0x220 drivers/media/rc/imon.c:503 usb_open+0x204/0x2e0 drivers/usb/core/file.c:48 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b4/0x1090 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3371 do_filp_open+0x17e/0x3c0 fs/namei.c:3398 do_sys_openat2+0x16d/0x420 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1192 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x417d11 Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 6a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 b3 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f36ce249810 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 000000000119c028 RCX: 0000000000417d11 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 00007f36ce249840 RBP: 000000000119c068 R08: 0000000000000000 R09: 000000000000000f R10: 0000000000000064 R11: 0000000000000293 R12: 000000000119c034 R13: 00007fffa65c775f R14: 00007f36ce24a9c0 R15: 000000000119c034