============================================ WARNING: possible recursive locking detected 5.10.0-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/12597 is trying to acquire lock: ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_write include/linux/fs.h:493 [inline] ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: unmap_ref_private mm/hugetlb.c:4019 [inline] ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: hugetlb_cow+0xf55/0x16c0 mm/hugetlb.c:4110 but task is already holding lock: ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_read include/linux/fs.h:508 [inline] ffff888015a811c8 (&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.0/12597: #0: ffff88801f183258 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801f183258 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x25f/0xc60 arch/x86/mm/fault.c:1334 #1: ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: i_mmap_lock_read include/linux/fs.h:508 [inline] #1: ffff888015a811c8 (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at: hugetlb_fault+0x2c1/0x24f0 mm/hugetlb.c:4485 #2: ffff8880122b47b8 (&hugetlb_fault_mutex_table[i]){+.+.}-{3:3}, at: hugetlb_fault+0x433/0x24f0 mm/hugetlb.c:4499 stack backtrace: CPU: 1 PID: 12597 Comm: syz-executor.0 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:ffffc90015cefd88 EFLAGS: 00010202 RAX: 000000000000895e RBX: 0000000000000000 RCX: 0000000000000004 RDX: 0000000000000000 RSI: 00000000f5567020 RDI: 00000000200004c0 RBP: 0000000000000000 R08: 000000306d616574 R09: 0000000000000000 R10: ffffffff86ff6117 R11: 0000000000008933 R12: 0000000000000023 R13: 00000000f5567020 R14: 0000000000000000 R15: 00000000200004c0 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_in_user arch/x86/include/asm/uaccess_64.h:64 [inline] copy_in_user include/linux/uaccess.h:209 [inline] compat_ifreq_ioctl net/socket.c:3321 [inline] compat_sock_ioctl_trans net/socket.c:3465 [inline] compat_sock_ioctl+0x1534/0x1d30 net/socket.c:3498 __do_compat_sys_ioctl+0x1d3/0x230 fs/ioctl.c:842 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7f6d549 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f55670cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 0000000000008933 RDX: 00000000200004c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000