====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc4-syzkaller-00241-gff83fec8179e #0 Not tainted ------------------------------------------------------ syz-executor.0/5209 is trying to acquire lock: ffff88807857f090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffff888075079b98 (&mm->mmap_lock ){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] ){++++}-{3:3}, at: vm_mmap_pgoff+0x159/0x280 mm/util.c:518 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:5647 [inline] __might_fault+0x10c/0x180 mm/memory.c:5640 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:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 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+0x247/0x11e0 fs/fs-writeback.c:2419 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] touch_atime+0x641/0x700 fs/inode.c:1944 file_accessed include/linux/fs.h:2519 [inline] generic_file_mmap+0x119/0x150 mm/filemap.c:3473 call_mmap include/linux/fs.h:2194 [inline] mmap_region+0x6c3/0x1dd0 mm/mmap.c:2625 do_mmap+0x831/0xf60 mm/mmap.c:1411 vm_mmap_pgoff+0x1af/0x280 mm/util.c:520 ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1457 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-executor.0/5209: #0: ffff888075079b98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff888075079b98 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x159/0x280 mm/util.c:518 #1: ffff888079988460 (sb_writers#13){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2519 [inline] #1: ffff888079988460 (sb_writers#13){.+.+}-{0:0}, at: generic_file_mmap+0x119/0x150 mm/filemap.c:3473 stack backtrace: CPU: 0 PID: 5209 Comm: syz-executor.0 Not tainted 6.2.0-rc4-syzkaller-00241-gff83fec8179e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 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+0x247/0x11e0 fs/fs-writeback.c:2419 generic_update_time fs/inode.c:1859 [inline] inode_update_time fs/inode.c:1872 [inline] touch_atime+0x641/0x700 fs/inode.c:1944 file_accessed include/linux/fs.h:2519 [inline] generic_file_mmap+0x119/0x150 mm/filemap.c:3473 call_mmap include/linux/fs.h:2194 [inline] mmap_region+0x6c3/0x1dd0 mm/mmap.c:2625 do_mmap+0x831/0xf60 mm/mmap.c:1411 vm_mmap_pgoff+0x1af/0x280 mm/util.c:520 ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1457 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:0x7f104ce8c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f104c1fe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f104cfabf80 RCX: 00007f104ce8c0c9 RDX: 0000000000800001 RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 00007f104cee7ae9 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000028011 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffebee1312f R14: 00007f104c1fe300 R15: 0000000000022000