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.1.0-syzkaller-11674-g84e57d292203 #0 Not tainted ------------------------------------------------------ syz-executor385/5680 is trying to acquire lock: ffff88801825c090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x77/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88801c4ee198 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] ffff88801c4ee198 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x14d/0x2b0 mm/util.c:518 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock#2){++++}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 __might_fault+0xb2/0x110 mm/memory.c:5647 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:2419 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] touch_atime+0x3d3/0x630 fs/inode.c:1944 file_accessed include/linux/fs.h:2516 [inline] generic_file_mmap+0xbb/0x120 mm/filemap.c:3473 call_mmap include/linux/fs.h:2191 [inline] mmap_region+0xfe6/0x1e20 mm/mmap.c:2621 do_mmap+0x8d9/0xf30 mm/mmap.c:1411 vm_mmap_pgoff+0x19e/0x2b0 mm/util.c:520 ksys_mmap_pgoff+0x48c/0x6d0 mm/mmap.c:1457 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock#2); lock(&sbi->lock); lock(&mm->mmap_lock#2); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor385/5680: #0: ffff88801c4ee198 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff88801c4ee198 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x14d/0x2b0 mm/util.c:518 #1: ffff888020cca460 (sb_writers#9){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2516 [inline] #1: ffff888020cca460 (sb_writers#9){.+.+}-{0:0}, at: generic_file_mmap+0xbb/0x120 mm/filemap.c:3473 stack backtrace: CPU: 1 PID: 5680 Comm: syz-executor385 Not tainted 6.1.0-syzkaller-11674-g84e57d292203 #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/0x290 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:2419 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] touch_atime+0x3d3/0x630 fs/inode.c:1944 file_accessed include/linux/fs.h:2516 [inline] generic_file_mmap+0xbb/0x120 mm/filemap.c:3473 call_mmap include/linux/fs.h:2191 [inline] mmap_region+0xfe6/0x1e20 mm/mmap.c:2621 do_mmap+0x8d9/0xf30 mm/mmap.c:1411 vm_mmap_pgoff+0x19e/0x2b0 mm/util.c:520 ksys_mmap_pgoff+0x48c/0x6d0 mm/mmap.c:1457 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 RIP: 0033:0x7f53cf293f79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 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:00007ffcd8b37098 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00000000000225f7 RCX: 00007f53cf293f79 RDX: 0000000000800001 RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000028011 R11: 0000000000000246 R12: 00007ffcd8b370cc R13: 00007ffcd8b37100 R14: 00007ffcd8b370e0 R15: 000000000000012b