====================================================== WARNING: possible circular locking dependency detected 6.6.0-syzkaller-12715-g6bdfe2d88b9f #0 Not tainted ------------------------------------------------------ syz-executor420/5061 is trying to acquire lock: ffff888016280090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff8880213b4da0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] ffff8880213b4da0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x17b/0x410 mm/util.c:544 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc1/0x120 mm/memory.c:5955 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:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #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:2452 generic_update_time fs/inode.c:1941 [inline] inode_update_time fs/inode.c:1954 [inline] touch_atime+0x34d/0x590 fs/inode.c:2026 file_accessed include/linux/fs.h:2360 [inline] generic_file_mmap+0xc6/0x120 mm/filemap.c:3611 call_mmap include/linux/fs.h:2025 [inline] mmap_region+0xef2/0x2240 mm/mmap.c:2851 do_mmap+0x8d3/0xfa0 mm/mmap.c:1379 vm_mmap_pgoff+0x1dc/0x410 mm/util.c:546 ksys_mmap_pgoff+0x4ff/0x6d0 mm/mmap.c:1425 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b 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-executor420/5061: #0: ffff8880213b4da0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] #0: ffff8880213b4da0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x17b/0x410 mm/util.c:544 #1: ffff888020f5c418 (sb_writers#9){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2360 [inline] #1: ffff888020f5c418 (sb_writers#9){.+.+}-{0:0}, at: generic_file_mmap+0xc6/0x120 mm/filemap.c:3611 stack backtrace: CPU: 1 PID: 5061 Comm: syz-executor420 Not tainted 6.6.0-syzkaller-12715-g6bdfe2d88b9f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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:2452 generic_update_time fs/inode.c:1941 [inline] inode_update_time fs/inode.c:1954 [inline] touch_atime+0x34d/0x590 fs/inode.c:2026 file_accessed include/linux/fs.h:2360 [inline] generic_file_mmap+0xc6/0x120 mm/filemap.c:3611 call_mmap include/linux/fs.h:2025 [inline] mmap_region+0xef2/0x2240 mm/mmap.c:2851 do_mmap+0x8d3/0xfa0 mm/mmap.c:1379 vm_mmap_pgoff+0x1dc/0x410 mm/util.c:546 ksys_mmap_pgoff+0x4ff/0x6d0 mm/mmap.c:1425 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f8b8b3021e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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:00007ffd9a277028 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f8b8b3021e9 RDX: 0000000000000002 RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000028011 R11: 0000000000000246 R12: 00007ffd9a27705c R13: 0000000000000004 R14: 431bde82d7b634db R15: 00007ffd9a277090