====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc6-syzkaller-00029-g213f891525c2 #0 Not tainted ------------------------------------------------------ syz-executor.3/7892 is trying to acquire lock: ffff88807794a090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff888038c2c508 (sb_pagefaults#6){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2931 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#6){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1571 [inline] sb_start_pagefault include/linux/fs.h:1675 [inline] filemap_page_mkwrite+0x16f/0x640 mm/filemap.c:3628 do_page_mkwrite+0x197/0x470 mm/memory.c:2931 wp_page_shared mm/memory.c:3291 [inline] do_wp_page+0xf87/0x4190 mm/memory.c:3376 handle_pte_fault mm/memory.c:4994 [inline] __handle_mm_fault mm/memory.c:5119 [inline] handle_mm_fault+0x1b45/0x62b0 mm/memory.c:5284 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc1/0x120 mm/memory.c:5896 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:50 [inline] do_syscall_64+0x41/0xc0 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:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 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/0xd90 fs/fs-writeback.c:2435 generic_update_time fs/inode.c:1936 [inline] inode_update_time fs/inode.c:1949 [inline] __file_update_time fs/inode.c:2135 [inline] file_update_time+0x191/0x1b0 fs/inode.c:2165 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3629 do_page_mkwrite+0x197/0x470 mm/memory.c:2931 wp_page_shared mm/memory.c:3291 [inline] do_wp_page+0xf87/0x4190 mm/memory.c:3376 handle_pte_fault mm/memory.c:4994 [inline] __handle_mm_fault mm/memory.c:5119 [inline] handle_mm_fault+0x1b45/0x62b0 mm/memory.c:5284 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 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 --> &mm->mmap_lock --> sb_pagefaults#6 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#6); lock(&mm->mmap_lock); lock(sb_pagefaults#6); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.3/7892: #0: ffff88802a4527a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #0: ffff88802a4527a0 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5311 [inline] #0: ffff88802a4527a0 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x2d0 mm/memory.c:5371 #1: ffff888038c2c508 (sb_pagefaults#6){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2931 stack backtrace: CPU: 0 PID: 7892 Comm: syz-executor.3 Not tainted 6.6.0-rc6-syzkaller-00029-g213f891525c2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x375/0x4a0 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+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 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/0xd90 fs/fs-writeback.c:2435 generic_update_time fs/inode.c:1936 [inline] inode_update_time fs/inode.c:1949 [inline] __file_update_time fs/inode.c:2135 [inline] file_update_time+0x191/0x1b0 fs/inode.c:2165 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3629 do_page_mkwrite+0x197/0x470 mm/memory.c:2931 wp_page_shared mm/memory.c:3291 [inline] do_wp_page+0xf87/0x4190 mm/memory.c:3376 handle_pte_fault mm/memory.c:4994 [inline] __handle_mm_fault mm/memory.c:5119 [inline] handle_mm_fault+0x1b45/0x62b0 mm/memory.c:5284 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7f1d3405db98 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:00007ffcb4426a78 EFLAGS: 00010246 RAX: 0000000020000400 RBX: 00007ffcb4426b88 RCX: 0032656c69662f2e RDX: 0000000000000008 RSI: 0032656c69662f2e RDI: 0000000020000400 RBP: 0000000000000fd2 R08: 00007f1d34000000 R09: 0000000000000171 R10: 0000000081be8703 R11: 0000000000000246 R12: 00007f1d33c02378 R13: fffffffffffffffe R14: 00007f1d33c00000 R15: 00007f1d33c02380