============================================ WARNING: possible recursive locking detected 5.10.0-syzkaller #0 Not tainted -------------------------------------------- syz-executor.4/20153 is trying to acquire lock: ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_write include/linux/fs.h:493 [inline] ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: unmap_ref_private mm/hugetlb.c:4019 [inline] ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: hugetlb_cow+0xf55/0x16c0 mm/hugetlb.c:4110 but task is already holding lock: ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_read include/linux/fs.h:508 [inline] ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: hugetlb_fault+0x2c1/0x24f0 mm/hugetlb.c:4485 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&hugetlbfs_i_mmap_rwsem_key); lock(&hugetlbfs_i_mmap_rwsem_key); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by syz-executor.4/20153: #0: ffff88802959ba18 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88802959ba18 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x25f/0xc60 arch/x86/mm/fault.c:1334 #1: ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_read include/linux/fs.h:508 [inline] #1: ffff88802d947458 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: hugetlb_fault+0x2c1/0x24f0 mm/hugetlb.c:4485 #2: ffff8880156404e8 (&hugetlb_fault_mutex_table[i]){+.+.}-{3:3}, at: hugetlb_fault+0x433/0x24f0 mm/hugetlb.c:4499 stack backtrace: CPU: 1 PID: 20153 Comm: syz-executor.4 Not tainted 5.10.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:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_deadlock_bug kernel/locking/lockdep.c:2761 [inline] check_deadlock kernel/locking/lockdep.c:2804 [inline] validate_chain kernel/locking/lockdep.c:3595 [inline] __lock_acquire.cold+0x115/0x3e6 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x750 kernel/locking/lockdep.c:5402 down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 i_mmap_lock_write include/linux/fs.h:493 [inline] unmap_ref_private mm/hugetlb.c:4019 [inline] hugetlb_cow+0xf55/0x16c0 mm/hugetlb.c:4110 hugetlb_fault+0x1708/0x24f0 mm/hugetlb.c:4562 handle_mm_fault+0x11b8/0x5760 mm/memory.c:4616 do_user_addr_fault+0x458/0xc60 arch/x86/mm/fault.c:1393 handle_page_fault arch/x86/mm/fault.c:1450 [inline] exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1506 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 RIP: 0010:copy_user_generic_unrolled+0x89/0xc0 arch/x86/lib/copy_user_64.S:92 Code: 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 40 48 8d 7f 40 ff c9 75 b6 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a RSP: 0018:ffffc90001e77e50 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffc90001e77ea8 RDI: 0000000020000080 RBP: 0000000020000080 R08: 0000000700000006 R09: ffffc90001e77eaf R10: fffff520003cefd5 R11: 0000000000000000 R12: 0000000020000088 R13: ffffc90001e77ea8 R14: 0000000000000000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] _copy_to_user lib/usercopy.c:33 [inline] _copy_to_user+0xd4/0x150 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:200 [inline] do_pipe2+0x128/0x1b0 fs/pipe.c:994 __do_sys_pipe2 fs/pipe.c:1010 [inline] __se_sys_pipe2 fs/pipe.c:1008 [inline] __x64_sys_pipe2+0x50/0x70 fs/pipe.c:1008 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e149 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb5b741dc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000125 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 000000000045e149 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 000000000119bfb8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffe77310e4f R14: 00007fb5b741e9c0 R15: 000000000119bf8c