====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc3-syzkaller-00024-g18d46e76d7c2 #0 Not tainted ------------------------------------------------------ syz-executor.2/8161 is trying to acquire lock: ffff8880243a1090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88802b602510 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_pagefaults){.+.+}-{0:0}: 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+0x174/0x7a0 mm/filemap.c:3577 do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0xaa9/0x36b0 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7d/0x3d70 mm/memory.c:5179 handle_mm_fault+0x47a/0xa10 mm/memory.c:5344 do_user_addr_fault+0x30b/0x1000 arch/x86/mm/fault.c:1364 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5d/0xc0 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}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 vma_start_write include/linux/mm.h:716 [inline] vma_link+0x3fa/0x730 mm/mmap.c:404 insert_vm_struct+0x1e3/0x450 mm/mmap.c:3378 __bprm_mm_init fs/exec.c:281 [inline] bprm_mm_init fs/exec.c:383 [inline] alloc_bprm+0x4c5/0xb00 fs/exec.c:1532 kernel_execve+0xaf/0x4e0 fs/exec.c:1987 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/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}: __might_fault mm/memory.c:5955 [inline] __might_fault+0x11f/0x1a0 mm/memory.c:5948 reiserfs_ioctl+0x1c4/0x2e0 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 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 kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xe6/0x270 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2452 generic_update_time+0xcf/0xf0 fs/inode.c:1943 inode_update_time fs/inode.c:1956 [inline] __file_update_time fs/inode.c:2144 [inline] file_update_time+0x12c/0x160 fs/inode.c:2174 filemap_page_mkwrite+0x295/0x7a0 mm/filemap.c:3578 do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0xaa9/0x36b0 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7d/0x3d70 mm/memory.c:5179 handle_mm_fault+0x47a/0xa10 mm/memory.c:5344 do_user_addr_fault+0x30b/0x1000 arch/x86/mm/fault.c:1364 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5d/0xc0 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 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults); lock(&vma->vm_lock->lock); lock(sb_pagefaults); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.2/8161: #0: ffff88801f84f730 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:663 [inline] #0: ffff88801f84f730 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x1da/0x940 mm/memory.c:5500 #1: ffff88802b602510 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 stack backtrace: CPU: 0 PID: 8161 Comm: syz-executor.2 Not tainted 6.7.0-rc3-syzkaller-00024-g18d46e76d7c2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x317/0x400 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 kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xe6/0x270 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2452 generic_update_time+0xcf/0xf0 fs/inode.c:1943 inode_update_time fs/inode.c:1956 [inline] __file_update_time fs/inode.c:2144 [inline] file_update_time+0x12c/0x160 fs/inode.c:2174 filemap_page_mkwrite+0x295/0x7a0 mm/filemap.c:3578 do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0xaa9/0x36b0 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7d/0x3d70 mm/memory.c:5179 handle_mm_fault+0x47a/0xa10 mm/memory.c:5344 do_user_addr_fault+0x30b/0x1000 arch/x86/mm/fault.c:1364 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7f7417c5d3db Code: fa 10 73 2d 83 fa 08 73 46 83 fa 04 73 16 83 fa 01 7c 10 8a 0e 74 0a 0f b7 74 16 fe 66 89 74 17 fe 88 0f c3 8b 4c 16 fc 8b 36 <89> 4c 17 fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5 RSP: 002b:00007ffc99847398 EFLAGS: 00010202 RAX: 0000000020000000 RBX: 00007ffc998474a8 RCX: 0000000000737562 RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 0000000020000000 RBP: 0000000000000032 R08: 00007f7417c00000 R09: 0000000000000a72 R10: 0000000081730588 R11: 0000000000000246 R12: 00007f7417801cc8 R13: fffffffffffffffe R14: 00007f7417800000 R15: 00007f7417801cd0