====================================================== WARNING: possible circular locking dependency detected 5.15.173-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/4244 is trying to acquire lock: ffff88806c22f090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88801b572558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults ){.+.+}-{0:0}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1813 [inline] sb_start_pagefault include/linux/fs.h:1912 [inline] filemap_page_mkwrite+0x11b/0x650 mm/filemap.c:3367 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 do_shared_fault mm/memory.c:4326 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x2803/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 -> #1 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __might_fault+0xb4/0x110 mm/memory.c:5355 reiserfs_ioctl+0x11d/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 ( &sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xee/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x2fd/0xd60 fs/fs-writeback.c:2464 generic_update_time+0x1cb/0x1e0 fs/inode.c:1856 inode_update_time fs/inode.c:1869 [inline] file_update_time+0x3eb/0x460 fs/inode.c:2058 filemap_page_mkwrite+0x222/0x650 mm/filemap.c:3368 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 do_shared_fault mm/memory.c:4326 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x2803/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 other info that might help us debug this: Chain exists of: &sbi->lock --> &mm->mmap_lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults); lock(&mm->mmap_lock); lock(sb_pagefaults); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.0/4244: #0: ffff888078f33928 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock+0x1c/0x50 include/linux/mmap_lock.h:117 #1: ffff88801b572558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 stack backtrace: CPU: 0 PID: 4244 Comm: syz-executor.0 Not tainted 5.15.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xee/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x2fd/0xd60 fs/fs-writeback.c:2464 generic_update_time+0x1cb/0x1e0 fs/inode.c:1856 inode_update_time fs/inode.c:1869 [inline] file_update_time+0x3eb/0x460 fs/inode.c:2058 filemap_page_mkwrite+0x222/0x650 mm/filemap.c:3368 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 do_shared_fault mm/memory.c:4326 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x2803/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 RIP: 0033:0x7fae72f8caeb 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:00007fff68cfd0b8 EFLAGS: 00010202 RAX: 00000000200000c0 RBX: 00007fff68cfd1c8 RCX: 0000000000737562 RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 00000000200000c0 RBP: 0000000000000032 R08: 00007fae72f2f000 R09: 00007fae730caf8c R10: 00007fff68cfd1f0 R11: 0000000000000246 R12: 00007fae72b30460 R13: fffffffffffffffe R14: 00007fae72b2f000 R15: 00007fae72b30468