====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc5-syzkaller-00230-g3b8a9b2e6809 #0 Not tainted ------------------------------------------------------ syz-executor.0/24033 is trying to acquire lock: ffff8880515d5090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88804f94a510 (sb_pagefaults#3){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2944 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_pagefaults#3){.+.+}-{0:0}: lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1635 [inline] sb_start_pagefault include/linux/fs.h:1739 [inline] filemap_page_mkwrite+0x16f/0x640 mm/filemap.c:3577 do_page_mkwrite+0x197/0x470 mm/memory.c:2944 wp_page_shared mm/memory.c:3339 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3479 handle_pte_fault mm/memory.c:5055 [inline] __handle_mm_fault mm/memory.c:5180 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5345 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x456/0x870 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 -> #2 (&vma->vm_lock->lock){++++}-{3:3}: lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 vma_start_write include/linux/mm.h:716 [inline] vma_link+0x2c9/0x540 mm/mmap.c:404 insert_vm_struct+0x19f/0x260 mm/mmap.c:3378 __bprm_mm_init fs/exec.c:281 [inline] bprm_mm_init fs/exec.c:383 [inline] alloc_bprm+0x4d5/0x900 fs/exec.c:1532 kernel_execve+0x96/0xa20 fs/exec.c:1987 call_usermodehelper_exec_async+0x233/0x370 kernel/umh.c:110 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 -> #1 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 __might_fault+0xc1/0x120 mm/memory.c:5956 reiserfs_ioctl+0x125/0x2f0 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x1909/0x5ab0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xf2/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x305/0xda0 fs/fs-writeback.c:2452 generic_update_time fs/inode.c:1943 [inline] inode_update_time fs/inode.c:1956 [inline] __file_update_time fs/inode.c:2144 [inline] file_update_time+0x39b/0x3e0 fs/inode.c:2174 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2944 wp_page_shared mm/memory.c:3339 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3479 handle_pte_fault mm/memory.c:5055 [inline] __handle_mm_fault mm/memory.c:5180 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5345 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x456/0x870 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 other info that might help us debug this: Chain exists of: &sbi->lock --> &vma->vm_lock->lock --> sb_pagefaults#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#3); lock(&vma->vm_lock->lock); lock(sb_pagefaults#3); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.0/24033: #0: ffff888024d0e2f8 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:663 [inline] #0: ffff888024d0e2f8 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x2f6/0x6f0 mm/memory.c:5501 #1: ffff88804f94a510 (sb_pagefaults#3){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2944 stack backtrace: CPU: 1 PID: 24033 Comm: syz-executor.0 Not tainted 6.7.0-rc5-syzkaller-00230-g3b8a9b2e6809 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x366/0x490 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x1909/0x5ab0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xf2/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x305/0xda0 fs/fs-writeback.c:2452 generic_update_time fs/inode.c:1943 [inline] inode_update_time fs/inode.c:1956 [inline] __file_update_time fs/inode.c:2144 [inline] file_update_time+0x39b/0x3e0 fs/inode.c:2174 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2944 wp_page_shared mm/memory.c:3339 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3479 handle_pte_fault mm/memory.c:5055 [inline] __handle_mm_fault mm/memory.c:5180 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5345 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x456/0x870 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fcd9d02b401 Code: 48 8b 54 24 08 48 85 d2 74 17 8b 44 24 18 0f c8 89 c0 48 89 44 24 18 48 83 fa 01 0f 85 b3 01 00 00 48 8b 44 24 10 8b 54 24 18 <89> 10 e9 15 fd ff ff 48 8b 44 24 10 8b 10 48 8b 44 24 08 48 85 c0 RSP: 002b:00007fffffee5820 EFLAGS: 00010246 RAX: 0000000020000140 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000555557033360 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000081bff719 R11: 0000000000000246 R12: 00007fcd9cc01b10 R13: fffffffffffffffe R14: 00007fcd9cc00000 R15: 00007fcd9cc01b18