====================================================== WARNING: possible circular locking dependency detected 5.4.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/10146 is trying to acquire lock: ffff8880921fd558 (&mm->mmap_sem#2){++++}, at: __might_fault+0xfb/0x1e0 mm/memory.c:4543 but task is already holding lock: ffff888092c8f900 (&rp->fetch_lock){+.+.}, at: mon_bin_fetch+0x37/0x340 drivers/usb/mon/mon_bin.c:909 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rp->fetch_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:959 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1106 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1121 mon_bin_vma_fault+0x73/0x2d0 drivers/usb/mon/mon_bin.c:1237 __do_fault+0x111/0x540 mm/memory.c:3188 do_cow_fault mm/memory.c:3614 [inline] do_fault mm/memory.c:3716 [inline] handle_pte_fault mm/memory.c:3945 [inline] __handle_mm_fault+0x1258/0x3da0 mm/memory.c:4075 handle_mm_fault+0x3b2/0xa50 mm/memory.c:4112 faultin_page mm/gup.c:640 [inline] __get_user_pages+0x7b2/0x1ac0 mm/gup.c:851 populate_vma_page_range+0x20d/0x2a0 mm/gup.c:1235 __mm_populate+0x204/0x380 mm/gup.c:1283 mm_populate include/linux/mm.h:2347 [inline] vm_mmap_pgoff+0x213/0x230 mm/util.c:511 ksys_mmap_pgoff+0x4aa/0x630 mm/mmap.c:1607 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&mm->mmap_sem#2){++++}: check_prev_add kernel/locking/lockdep.c:2476 [inline] check_prevs_add kernel/locking/lockdep.c:2581 [inline] validate_chain kernel/locking/lockdep.c:2971 [inline] __lock_acquire+0x2596/0x4a00 kernel/locking/lockdep.c:3955 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 __might_fault mm/memory.c:4544 [inline] __might_fault+0x15e/0x1e0 mm/memory.c:4529 mon_bin_fetch+0x26f/0x340 drivers/usb/mon/mon_bin.c:928 mon_bin_ioctl+0x21e/0xc80 drivers/usb/mon/mon_bin.c:1091 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:545 [inline] do_vfs_ioctl+0x977/0x14e0 fs/ioctl.c:732 ksys_ioctl+0xab/0xd0 fs/ioctl.c:749 __do_sys_ioctl fs/ioctl.c:756 [inline] __se_sys_ioctl fs/ioctl.c:754 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:754 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rp->fetch_lock); lock(&mm->mmap_sem#2); lock(&rp->fetch_lock); lock(&mm->mmap_sem#2); *** DEADLOCK *** 1 lock held by syz-executor.4/10146: #0: ffff888092c8f900 (&rp->fetch_lock){+.+.}, at: mon_bin_fetch+0x37/0x340 drivers/usb/mon/mon_bin.c:909 stack backtrace: CPU: 1 PID: 10146 Comm: syz-executor.4 Not tainted 5.4.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_circular_bug.isra.0.cold+0x163/0x172 kernel/locking/lockdep.c:1685 check_noncircular+0x32e/0x3e0 kernel/locking/lockdep.c:1809 check_prev_add kernel/locking/lockdep.c:2476 [inline] check_prevs_add kernel/locking/lockdep.c:2581 [inline] validate_chain kernel/locking/lockdep.c:2971 [inline] __lock_acquire+0x2596/0x4a00 kernel/locking/lockdep.c:3955 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 __might_fault mm/memory.c:4544 [inline] __might_fault+0x15e/0x1e0 mm/memory.c:4529 mon_bin_fetch+0x26f/0x340 drivers/usb/mon/mon_bin.c:928 mon_bin_ioctl+0x21e/0xc80 drivers/usb/mon/mon_bin.c:1091 vfs_ioctl fs/ioctl.c:47 [inline] file_ioctl fs/ioctl.c:545 [inline] do_vfs_ioctl+0x977/0x14e0 fs/ioctl.c:732 ksys_ioctl+0xab/0xd0 fs/ioctl.c:749 __do_sys_ioctl fs/ioctl.c:756 [inline] __se_sys_ioctl fs/ioctl.c:754 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:754 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a6f9 Code: Bad RIP value. RSP: 002b:00007f4cb4edec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a6f9 RDX: 0000000020000100 RSI: 00000000c0109207 RDI: 000000000000000b RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4cb4edf6d4 R13: 00000000004c435c R14: 00000000004d99e0 R15: 00000000ffffffff