====================================================== WARNING: possible circular locking dependency detected 4.14.157-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/18134 is trying to acquire lock: (&mm->mmap_sem){++++}, at: [] __might_fault+0xe0/0x1d0 mm/memory.c:4583 but task is already holding lock: (&rp->fetch_lock){+.+.}, at: [] mon_bin_read+0x5d/0x5e0 drivers/usb/mon/mon_bin.c:813 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rp->fetch_lock){+.+.}: kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 mon_bin_vma_fault+0x6f/0x280 drivers/usb/mon/mon_bin.c:1236 kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' __do_fault+0x104/0x390 mm/memory.c:3223 do_cow_fault mm/memory.c:3662 [inline] do_fault mm/memory.c:3761 [inline] handle_pte_fault mm/memory.c:3989 [inline] __handle_mm_fault+0xd96/0x33d0 mm/memory.c:4113 handle_mm_fault+0x293/0x7c0 mm/memory.c:4150 faultin_page mm/gup.c:514 [inline] __get_user_pages+0x465/0x12e0 mm/gup.c:714 populate_vma_page_range+0x18e/0x230 mm/gup.c:1231 __mm_populate+0x198/0x2c0 mm/gup.c:1279 mm_populate include/linux/mm.h:2182 [inline] vm_mmap_pgoff+0x1be/0x1d0 mm/util.c:338 SYSC_mmap_pgoff mm/mmap.c:1551 [inline] SyS_mmap_pgoff+0x3ca/0x520 mm/mmap.c:1509 SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (&mm->mmap_sem){++++}: check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 __might_fault mm/memory.c:4584 [inline] __might_fault+0x143/0x1d0 mm/memory.c:4569 _copy_to_user+0x2c/0xd0 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] mon_bin_read+0x2fb/0x5e0 drivers/usb/mon/mon_bin.c:825 __vfs_read+0x105/0x6a0 fs/read_write.c:411 vfs_read+0x137/0x350 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xfd/0x230 fs/read_write.c:567 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rp->fetch_lock); lock(&mm->mmap_sem); lock(&rp->fetch_lock); lock(&mm->mmap_sem); *** DEADLOCK *** 1 lock held by syz-executor.0/18134: #0: (&rp->fetch_lock){+.+.}, at: [] mon_bin_read+0x5d/0x5e0 drivers/usb/mon/mon_bin.c:813 stack backtrace: CPU: 1 PID: 18134 Comm: syz-executor.0 Not tainted 4.14.157-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x142/0x197 lib/dump_stack.c:58 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 __might_fault mm/memory.c:4584 [inline] __might_fault+0x143/0x1d0 mm/memory.c:4569 _copy_to_user+0x2c/0xd0 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] mon_bin_read+0x2fb/0x5e0 drivers/usb/mon/mon_bin.c:825 __vfs_read+0x105/0x6a0 fs/read_write.c:411 vfs_read+0x137/0x350 fs/read_write.c:447 SYSC_read fs/read_write.c:574 [inline] SyS_read+0xfd/0x230 fs/read_write.c:567 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45a679 RSP: 002b:00007f80187ffc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679 RDX: 00000000000000d0 RSI: 0000000020000080 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f80188006d4 R13: 00000000004c8baf R14: 00000000004e03a8 R15: 00000000ffffffff kobject: 'loop5' (ffff8880a417f6e0): kobject_uevent_env kobject: 'loop5' (ffff8880a417f6e0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop2' (ffff8880a4072460): kobject_uevent_env kobject: 'loop2' (ffff8880a4072460): fill_kobj_path: path = '/devices/virtual/block/loop2' ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 kobject: 'loop4' (ffff8880a4149660): kobject_uevent_env kobject: 'loop4' (ffff8880a4149660): fill_kobj_path: path = '/devices/virtual/block/loop4' ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=264 sclass=netlink_xfrm_socket pig=18167 comm=syz-executor.1 kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' SELinux: unrecognized netlink message: protocol=6 nlmsg_type=26159 sclass=netlink_xfrm_socket pig=18185 comm=syz-executor.0 kobject: 'loop2' (ffff8880a4072460): kobject_uevent_env kobject: 'loop2' (ffff8880a4072460): fill_kobj_path: path = '/devices/virtual/block/loop2' ptrace attach of "/root/syz-executor.3"[18189] was attempted by "/root/syz-executor.3"[18190] kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop5' (ffff8880a417f6e0): kobject_uevent_env kobject: 'loop5' (ffff8880a417f6e0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (ffff8880a4149660): kobject_uevent_env kobject: 'loop4' (ffff8880a4149660): fill_kobj_path: path = '/devices/virtual/block/loop4' net_ratelimit: 4 callbacks suppressed ip6gretap0: Invalid MTU 0 requested, hw min 68 ptrace attach of "/root/syz-executor.3"[18205] was attempted by "/root/syz-executor.3"[18208] ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 ptrace attach of "/root/syz-executor.3"[18222] was attempted by "/root/syz-executor.3"[18223] kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 ip6gretap0: Invalid MTU 0 requested, hw min 68 kobject: 'loop2' (ffff8880a4072460): kobject_uevent_env kobject: 'loop2' (ffff8880a4072460): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'loop2' (ffff8880a4072460): kobject_uevent_env kobject: 'loop2' (ffff8880a4072460): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop5' (ffff8880a417f6e0): kobject_uevent_env kobject: 'loop5' (ffff8880a417f6e0): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (ffff8880a4149660): kobject_uevent_env kobject: 'loop4' (ffff8880a4149660): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop4' (ffff8880a4149660): kobject_uevent_env kobject: 'loop4' (ffff8880a4149660): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop4' (ffff8880a4149660): kobject_uevent_env kobject: 'loop4' (ffff8880a4149660): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop3' (ffff8880a40e2d60): kobject_uevent_env kobject: 'loop3' (ffff8880a40e2d60): fill_kobj_path: path = '/devices/virtual/block/loop3'