====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc2-syzkaller-00147-gf1a09972a45a #0 Not tainted ------------------------------------------------------ syz-executor.1/31666 is trying to acquire lock: ffff8880340df090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88808543a510 (sb_pagefaults#7){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2943 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_pagefaults#7){.+.+}-{0:0}: lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 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:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5344 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:5753 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:5753 __might_fault+0xc1/0x120 mm/memory.c:5955 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:51 [inline] do_syscall_64+0x45/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+0x18e4/0x59f0 kernel/locking/lockdep.c:3868 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 __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:1941 [inline] inode_update_time fs/inode.c:1954 [inline] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x39b/0x3e0 fs/inode.c:2172 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5344 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#7 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#7); lock(&vma->vm_lock->lock); lock(sb_pagefaults#7); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.1/31666: #0: ffff888029c75a90 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:663 [inline] #0: ffff888029c75a90 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x2f6/0x6f0 mm/memory.c:5500 #1: ffff88808543a510 (sb_pagefaults#7){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2943 stack backtrace: CPU: 0 PID: 31666 Comm: syz-executor.1 Not tainted 6.7.0-rc2-syzkaller-00147-gf1a09972a45a #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+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+0x18e4/0x59f0 kernel/locking/lockdep.c:3868 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 __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:1941 [inline] inode_update_time fs/inode.c:1954 [inline] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x39b/0x3e0 fs/inode.c:2172 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2943 wp_page_shared mm/memory.c:3338 [inline] do_wp_page+0x1d07/0x4d40 mm/memory.c:3478 handle_pte_fault mm/memory.c:5054 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x1b1c/0x6680 mm/memory.c:5344 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:0x7f805a25db98 Code: fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5 fa 7f 4c 17 f0 c3 66 0f 1f 84 00 00 00 00 00 48 8b 4c 16 f8 48 8b 36 <48> 89 37 48 89 4c 17 f8 c3 c5 fe 6f 54 16 e0 c5 fe 6f 5c 16 c0 c5 RSP: 002b:00007ffd31ec6358 EFLAGS: 00010202 RAX: 0000000020000100 RBX: 00007ffd31ec6468 RCX: 0030656c69662f73 RDX: 000000000000000c RSI: 69662f7375622f2e RDI: 0000000020000100 RBP: 0000000000000032 R08: 00007f805a200000 R09: 00007ffd31fcb0b0 R10: 00007ffd31fcb080 R11: 0000000000092c34 R12: 00007f8059e01818 R13: fffffffffffffffe R14: 00007f8059e00000 R15: 00007f8059e01820