====================================================== WARNING: possible circular locking dependency detected 6.6.0-syzkaller-15365-g305230142ae0 #0 Not tainted ------------------------------------------------------ syz-executor.5/20888 is trying to acquire lock: ffff88804b71c090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88804a90e510 (sb_pagefaults#5){.+.+}-{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#5){.+.+}-{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/0x3a70 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7c/0x3d60 mm/memory.c:5179 handle_mm_fault+0x478/0xa00 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+0x5c/0xd0 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+0x93/0x200 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+0xf4/0x2d0 mm/mmap.c:3378 __bprm_mm_init fs/exec.c:281 [inline] bprm_mm_init fs/exec.c:383 [inline] alloc_bprm+0x4c5/0xaf0 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+0x3f/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:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 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/0xd50 fs/fs-writeback.c:2452 generic_update_time+0xcf/0xf0 fs/inode.c:1941 inode_update_time fs/inode.c:1954 [inline] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x12c/0x160 fs/inode.c:2172 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/0x3a70 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7c/0x3d60 mm/memory.c:5179 handle_mm_fault+0x478/0xa00 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+0x5c/0xd0 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#5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#5); lock(&vma->vm_lock->lock); lock(sb_pagefaults#5); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.5/20888: #0: ffff8880212f53d0 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:663 [inline] #0: ffff8880212f53d0 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x1da/0x940 mm/memory.c:5500 #1: ffff88804a90e510 (sb_pagefaults#5){.+.+}-{0:0}, at: do_page_mkwrite+0x17a/0x380 mm/memory.c:2943 stack backtrace: CPU: 1 PID: 20888 Comm: syz-executor.5 Not tainted 6.6.0-syzkaller-15365-g305230142ae0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 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:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 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/0xd50 fs/fs-writeback.c:2452 generic_update_time+0xcf/0xf0 fs/inode.c:1941 inode_update_time fs/inode.c:1954 [inline] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x12c/0x160 fs/inode.c:2172 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/0x3a70 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault+0x1d7c/0x3d60 mm/memory.c:5179 handle_mm_fault+0x478/0xa00 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+0x5c/0xd0 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fe1a325d331 Code: 0b 0f 1f 84 00 00 00 00 00 48 89 f8 48 83 fa 20 0f 82 93 00 00 00 c5 fe 6f 06 48 83 fa 40 0f 87 22 01 00 00 c5 fe 6f 4c 16 e0 fe 7f 07 c5 fe 7f 4c 17 e0 c5 f8 77 c3 90 48 89 f8 48 01 d0 eb RSP: 002b:00007ffcd81649d8 EFLAGS: 00010283 RAX: 0000000020000040 RBX: 00007ffcd8164ae8 RCX: 00007fe1a2e00000 RDX: 0000000000000025 RSI: 00007fe1a2e01468 RDI: 0000000020000040 RBP: 0000000000000032 R08: 00007fe1a3200000 R09: 0000000000001217 R10: 00000000813a745d R11: 0000000000000246 R12: 00007fe1a2e01448 R13: fffffffffffffffe R14: 00007fe1a2e00000 R15: 00007fe1a2e01450