audit: type=1400 audit(1556227535.908:36): avc: denied { map } for pid=7885 comm="syz-executor142" path="/root/syz-executor142574044" dev="sda1" ino=16484 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 audit: type=1400 audit(1556227535.938:37): avc: denied { map } for pid=7885 comm="syz-executor142" path="/dev/usbmon0" dev="devtmpfs" ino=15181 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usbmon_device_t:s0 tclass=chr_file permissive=1 ====================================================== WARNING: possible circular locking dependency detected 4.19.36 #4 Not tainted ------------------------------------------------------ syz-executor142/7886 is trying to acquire lock: 00000000ffd3bf0e (&mm->mmap_sem){++++}, at: __might_fault+0xfb/0x1e0 mm/memory.c:4629 but task is already holding lock: 000000005c4f3497 (&rp->fetch_lock){+.+.}, at: mon_bin_read+0x60/0x640 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){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf7/0x1300 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 mon_bin_vma_fault+0x73/0x2d0 drivers/usb/mon/mon_bin.c:1237 __do_fault+0x116/0x480 mm/memory.c:3263 do_cow_fault mm/memory.c:3704 [inline] do_fault mm/memory.c:3806 [inline] handle_pte_fault mm/memory.c:4035 [inline] __handle_mm_fault+0xf72/0x3f80 mm/memory.c:4159 handle_mm_fault+0x43f/0xb30 mm/memory.c:4196 faultin_page mm/gup.c:518 [inline] __get_user_pages+0x609/0x1770 mm/gup.c:718 populate_vma_page_range+0x20d/0x2a0 mm/gup.c:1222 __mm_populate+0x204/0x380 mm/gup.c:1270 mm_populate include/linux/mm.h:2315 [inline] vm_mmap_pgoff+0x213/0x230 mm/util.c:362 ksys_mmap_pgoff+0x4aa/0x630 mm/mmap.c:1585 __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+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&mm->mmap_sem){++++}: lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3903 __might_fault mm/memory.c:4630 [inline] __might_fault+0x15e/0x1e0 mm/memory.c:4615 _copy_to_user+0x30/0x120 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] mon_bin_read+0x329/0x640 drivers/usb/mon/mon_bin.c:825 __vfs_read+0x116/0x800 fs/read_write.c:416 vfs_read+0x194/0x3d0 fs/read_write.c:452 ksys_read+0xea/0x1f0 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:586 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 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); lock(&rp->fetch_lock); lock(&mm->mmap_sem); *** DEADLOCK *** 1 lock held by syz-executor142/7886: #0: 000000005c4f3497 (&rp->fetch_lock){+.+.}, at: mon_bin_read+0x60/0x640 drivers/usb/mon/mon_bin.c:813 stack backtrace: CPU: 0 PID: 7886 Comm: syz-executor142 Not tainted 4.19.36 #4 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+0x172/0x1f0 lib/dump_stack.c:113 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1861 [inline] check_prevs_add kernel/locking/lockdep.c:1974 [inline] validate_chain kernel/locking/lockdep.c:2415 [inline] __lock_acquire+0x2e6d/0x48f0 kernel/locking/lockdep.c:3411 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3903 __might_fault mm/memory.c:4630 [inline] __might_fault+0x15e/0x1e0 mm/memory.c:4615 _copy_to_user+0x30/0x120 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] mon_bin_read+0x329/0x640 drivers/usb/mon/mon_bin.c:825 __vfs_read+0x116/0x800 fs/read_write.c:416 vfs_read+0x194/0x3d0 fs/read_write.c:452 ksys_read+0xea/0x1f0 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:586 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x449739 Code: e8 ec b9 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 ab d6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4ddce14ce8 EFLAGS: 00000246 ORIG_