====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc6-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/5965 is trying to acquire lock: ffff8880207d9090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff888079d1c558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a4/0x600 mm/memory.c:2931 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults){.+.+}-{0:0}: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_pagefault include/linux/fs.h:1598 [inline] filemap_page_mkwrite+0x16f/0x640 mm/filemap.c:3566 do_page_mkwrite+0x1a4/0x600 mm/memory.c:2931 do_shared_fault mm/memory.c:4595 [inline] do_fault mm/memory.c:4663 [inline] do_pte_missing+0x733/0x2810 mm/memory.c:3647 handle_pte_fault mm/memory.c:4947 [inline] __handle_mm_fault mm/memory.c:5089 [inline] handle_mm_fault+0x16cf/0x2e30 mm/memory.c:5243 do_user_addr_fault arch/x86/mm/fault.c:1440 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x7c2/0x900 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 -> #1 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 __might_fault+0xba/0x120 mm/memory.c:5732 reiserfs_ioctl+0x121/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847 __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xf2/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x305/0xd90 fs/fs-writeback.c:2424 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] __file_update_time+0x221/0x240 fs/inode.c:2057 file_update_time+0x350/0x3c0 fs/inode.c:2088 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3567 do_page_mkwrite+0x1a4/0x600 mm/memory.c:2931 do_shared_fault mm/memory.c:4595 [inline] do_fault mm/memory.c:4663 [inline] do_pte_missing+0x733/0x2810 mm/memory.c:3647 handle_pte_fault mm/memory.c:4947 [inline] __handle_mm_fault mm/memory.c:5089 [inline] handle_mm_fault+0x16cf/0x2e30 mm/memory.c:5243 do_user_addr_fault arch/x86/mm/fault.c:1440 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x7c2/0x900 arch/x86/mm/fault.c:1590 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 --> &mm->mmap_lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults); lock(&mm->mmap_lock); lock(sb_pagefaults); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.5/5965: #0: ffff88807eaa0a68 ( &mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:142 [inline] &mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1391 [inline] &mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1534 [inline] &mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x698/0x900 arch/x86/mm/fault.c:1590 #1: ffff888079d1c558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a4/0x600 mm/memory.c:2931 stack backtrace: CPU: 1 PID: 5965 Comm: syz-executor.5 Not tainted 6.4.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847 __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xf2/0x240 fs/reiserfs/super.c:704 __mark_inode_dirty+0x305/0xd90 fs/fs-writeback.c:2424 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] __file_update_time+0x221/0x240 fs/inode.c:2057 file_update_time+0x350/0x3c0 fs/inode.c:2088 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3567 do_page_mkwrite+0x1a4/0x600 mm/memory.c:2931 do_shared_fault mm/memory.c:4595 [inline] do_fault mm/memory.c:4663 [inline] do_pte_missing+0x733/0x2810 mm/memory.c:3647 handle_pte_fault mm/memory.c:4947 [inline] __handle_mm_fault mm/memory.c:5089 [inline] handle_mm_fault+0x16cf/0x2e30 mm/memory.c:5243 do_user_addr_fault arch/x86/mm/fault.c:1440 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x7c2/0x900 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7f7130a86cc5 Code: 12 80 fa 04 73 1e 80 fa 01 77 26 72 05 0f b6 0e 88 0f c3 48 8b 4c 16 f8 48 8b 36 48 89 4c 17 f8 48 89 37 c3 8b 4c 16 fc 8b 36 <89> 4c 17 fc 89 37 c3 0f b7 4c 16 fe 0f b7 36 66 89 4c 17 fe 66 89 RSP: 002b:00007ffdc3953f58 EFLAGS: 00010202 RAX: 00000000200000c0 RBX: 0000000000000000 RCX: 0000000000737562 RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 00000000200000c0 RBP: 00007ffdc3954018 R08: 00007f7130a00000 R09: 00007f7130600000 R10: 00007f7130601468 R11: 0000000000000246 R12: 00000000000187b1 R13: 00007ffdc3954040 R14: 00007f7130babf80 R15: 0000000000000032