REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc4-next-20230331-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor408/5430 is trying to acquire lock: ffff888146285090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88807a742698 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:110 [inline] ffff88807a742698 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x158/0x3b0 mm/util.c:541 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault mm/memory.c:5725 [inline] __might_fault+0x115/0x190 mm/memory.c:5718 reiserfs_ioctl+0x1d2/0x330 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/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:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire.part.0+0x11c/0x370 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xd2/0x260 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2421 generic_update_time fs/inode.c:1860 [inline] inode_update_time fs/inode.c:1873 [inline] touch_atime+0x687/0x740 fs/inode.c:1945 file_accessed include/linux/fs.h:2184 [inline] generic_file_mmap+0x119/0x150 mm/filemap.c:3598 call_mmap include/linux/fs.h:1859 [inline] mmap_region+0x694/0x28d0 mm/mmap.c:2606 do_mmap+0x816/0xf20 mm/mmap.c:1393 vm_mmap_pgoff+0x1a4/0x3b0 mm/util.c:543 ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1439 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock); lock(&sbi->lock); lock(&mm->mmap_lock); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor408/5430: #0: ffff88807a742698 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:110 [inline] #0: ffff88807a742698 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x158/0x3b0 mm/util.c:541 #1: ffff88807c486460 (sb_writers#9){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2184 [inline] #1: ffff88807c486460 (sb_writers#9){.+.+}-{0:0}, at: generic_file_mmap+0x119/0x150 mm/filemap.c:3598 stack backtrace: CPU: 0 PID: 5430 Comm: syz-executor408 Not tainted 6.3.0-rc4-next-20230331-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire.part.0+0x11c/0x370 kernel/locking/lockdep.c:5691 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xd2/0x260 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2421 generic_update_time fs/inode.c:1860 [inline] inode_update_time fs/inode.c:1873 [inline] touch_atime+0x687/0x740 fs/inode.c:1945 file_accessed include/linux/fs.h:2184 [inline] generic_file_mmap+0x119/0x150 mm/filemap.c:3598 call_mmap include/linux/fs.h:1859 [inline] mmap_region+0x694/0x28d0 mm/mmap.c:2606 do_mmap+0x816/0xf20 mm/mmap.c:1393 vm_mmap_pgoff+0x1a4/0x3b0 mm/util.c:543 ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1439 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe060d0b969 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffeed94a928 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 000000000001f1d2 RCX: 00007fe060d0b969 RDX: 0000000000000001 RSI: 0000000000400000 RDI: 0000000020000000 RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000010012 R11: 0000000000000246 R12: 00007ffeed94a95c R13: 00007ffeed94a990 R14: 00007ffeed94a970 R15: 00000000000000a9