====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc8-syzkaller-00152-g3ecc37918c80 #0 Not tainted ------------------------------------------------------ syz-executor.1/21108 is trying to acquire lock: ffff88807b784090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x77/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff888074bea558 (sb_pagefaults#4){.+.+}-{0:0}, at: do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2977 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#4){.+.+}-{0:0}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1826 [inline] sb_start_pagefault include/linux/fs.h:1930 [inline] filemap_page_mkwrite+0x15c/0x7a0 mm/filemap.c:3420 do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2977 do_shared_fault mm/memory.c:4618 [inline] do_fault mm/memory.c:4686 [inline] handle_pte_fault mm/memory.c:4954 [inline] __handle_mm_fault mm/memory.c:5096 [inline] handle_mm_fault+0x1c63/0x3630 mm/memory.c:5217 do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x7a/0x110 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 -> #1 (&mm->mmap_lock#2){++++}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 __might_fault+0xb2/0x110 mm/memory.c:5645 reiserfs_ioctl+0x11c/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 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:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 reiserfs_write_lock+0x77/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xdf/0x230 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e7/0x600 fs/fs-writeback.c:2408 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] __file_update_time fs/inode.c:2088 [inline] file_update_time+0x551/0x5d0 fs/inode.c:2119 filemap_page_mkwrite+0x248/0x7a0 mm/filemap.c:3421 do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2977 do_shared_fault mm/memory.c:4618 [inline] do_fault mm/memory.c:4686 [inline] handle_pte_fault mm/memory.c:4954 [inline] __handle_mm_fault mm/memory.c:5096 [inline] handle_mm_fault+0x1c63/0x3630 mm/memory.c:5217 do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x7a/0x110 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 other info that might help us debug this: Chain exists of: &sbi->lock --> &mm->mmap_lock#2 --> sb_pagefaults#4 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults#4); lock(&mm->mmap_lock#2); lock(sb_pagefaults#4); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.1/21108: #0: ffff888021d666d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff888021d666d8 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x2e2/0xcb0 arch/x86/mm/fault.c:1369 #1: ffff888074bea558 (sb_pagefaults#4){.+.+}-{0:0}, at: do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2977 stack backtrace: CPU: 1 PID: 21108 Comm: syz-executor.1 Not tainted 6.1.0-rc8-syzkaller-00152-g3ecc37918c80 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 reiserfs_write_lock+0x77/0xd0 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xdf/0x230 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e7/0x600 fs/fs-writeback.c:2408 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] __file_update_time fs/inode.c:2088 [inline] file_update_time+0x551/0x5d0 fs/inode.c:2119 filemap_page_mkwrite+0x248/0x7a0 mm/filemap.c:3421 do_page_mkwrite+0x19e/0x5e0 mm/memory.c:2977 do_shared_fault mm/memory.c:4618 [inline] do_fault mm/memory.c:4686 [inline] handle_pte_fault mm/memory.c:4954 [inline] __handle_mm_fault mm/memory.c:5096 [inline] handle_mm_fault+0x1c63/0x3630 mm/memory.c:5217 do_user_addr_fault+0x69b/0xcb0 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x7a/0x110 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fa83202bd79 Code: 48 8b 04 24 48 85 c0 74 17 48 8b 54 24 18 48 0f ca 48 89 54 24 18 48 83 f8 01 0f 85 9b 02 00 00 48 8b 44 24 10 48 8b 54 24 18 <48> 89 10 e9 c2 fd ff ff 48 8b 44 24 10 0f b7 10 48 8b 04 24 48 85 RSP: 002b:00007ffe35860380 EFLAGS: 00010246 RAX: 00000000200001c0 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 00000000200000c0 RSI: 0000000000000000 RDI: 00005555567cc2e8 RBP: 00007ffe35860478 R08: 0000000000000000 R09: 0000000000000000 R10: 00007fa831c01448 R11: 0000000000000246 R12: 00000000000b8e40 R13: 00007ffe358604a0 R14: 00007fa8321abf80 R15: 0000000000000032