REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.1.119-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/3934 is trying to acquire lock: ffffc900046920f0 (&journal->j_mutex){+.+.}-{3:3}, at: reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline] ffffc900046920f0 (&journal->j_mutex){+.+.}-{3:3}, at: lock_journal fs/reiserfs/journal.c:534 [inline] ffffc900046920f0 (&journal->j_mutex){+.+.}-{3:3}, at: do_journal_begin_r+0x34e/0x1020 fs/reiserfs/journal.c:3049 but task is already holding lock: ffff88801feee558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:3009 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults){.+.+}-{0:0}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1891 [inline] sb_start_pagefault include/linux/fs.h:1995 [inline] filemap_page_mkwrite+0x16a/0x630 mm/filemap.c:3512 do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:3009 do_shared_fault mm/memory.c:4694 [inline] do_fault mm/memory.c:4762 [inline] handle_pte_fault mm/memory.c:5029 [inline] __handle_mm_fault mm/memory.c:5171 [inline] handle_mm_fault+0x22eb/0x5340 mm/memory.c:5292 do_user_addr_fault arch/x86/mm/fault.c:1340 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x26f/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 __put_user_nocheck_4+0x3/0x11 reiserfs_ioctl+0x14d/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&sbi->lock){+.+.}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 reiserfs_write_lock_nested+0x5b/0xd0 fs/reiserfs/lock.c:78 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:815 [inline] lock_journal fs/reiserfs/journal.c:534 [inline] do_journal_begin_r+0x359/0x1020 fs/reiserfs/journal.c:3049 journal_begin+0x148/0x350 fs/reiserfs/journal.c:3257 reiserfs_fill_super+0x184f/0x2620 fs/reiserfs/super.c:2104 mount_bdev+0x2c9/0x3f0 fs/super.c:1443 legacy_get_tree+0xeb/0x180 fs/fs_context.c:632 vfs_get_tree+0x88/0x270 fs/super.c:1573 do_new_mount+0x2ba/0xb40 fs/namespace.c:3056 do_mount fs/namespace.c:3399 [inline] __do_sys_mount fs/namespace.c:3607 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3584 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&journal->j_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline] lock_journal fs/reiserfs/journal.c:534 [inline] do_journal_begin_r+0x34e/0x1020 fs/reiserfs/journal.c:3049 journal_begin+0x148/0x350 fs/reiserfs/journal.c:3257 reiserfs_dirty_inode+0x11c/0x240 fs/reiserfs/super.c:710 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1942 [inline] inode_update_time fs/inode.c:1955 [inline] __file_update_time+0x221/0x240 fs/inode.c:2143 file_update_time+0x34c/0x3c0 fs/inode.c:2174 filemap_page_mkwrite+0x275/0x630 mm/filemap.c:3513 do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:3009 do_shared_fault mm/memory.c:4694 [inline] do_fault mm/memory.c:4762 [inline] handle_pte_fault mm/memory.c:5029 [inline] __handle_mm_fault mm/memory.c:5171 [inline] handle_mm_fault+0x22eb/0x5340 mm/memory.c:5292 do_user_addr_fault arch/x86/mm/fault.c:1340 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x26f/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 __put_user_nocheck_4+0x3/0x11 reiserfs_ioctl+0x14d/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &journal->j_mutex --> &sbi->lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults); lock(&sbi->lock); lock(sb_pagefaults); lock(&journal->j_mutex); *** DEADLOCK *** 2 locks held by syz-executor.0/3934: #0: ffff88807beaa6d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807beaa6d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5320 [inline] #0: ffff88807beaa6d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5382 #1: ffff88801feee558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:3009 stack backtrace: CPU: 0 PID: 3934 Comm: syz-executor.0 Not tainted 6.1.119-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline] lock_journal fs/reiserfs/journal.c:534 [inline] do_journal_begin_r+0x34e/0x1020 fs/reiserfs/journal.c:3049 journal_begin+0x148/0x350 fs/reiserfs/journal.c:3257 reiserfs_dirty_inode+0x11c/0x240 fs/reiserfs/super.c:710 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1942 [inline] inode_update_time fs/inode.c:1955 [inline] __file_update_time+0x221/0x240 fs/inode.c:2143 file_update_time+0x34c/0x3c0 fs/inode.c:2174 filemap_page_mkwrite+0x275/0x630 mm/filemap.c:3513 do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:3009 do_shared_fault mm/memory.c:4694 [inline] do_fault mm/memory.c:4762 [inline] handle_pte_fault mm/memory.c:5029 [inline] __handle_mm_fault mm/memory.c:5171 [inline] handle_mm_fault+0x22eb/0x5340 mm/memory.c:5292 do_user_addr_fault arch/x86/mm/fault.c:1340 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x26f/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:__put_user_nocheck_4+0x3/0x11 Code: 00 00 48 39 d9 73 54 0f 01 cb 66 89 01 31 c9 0f 01 ca c3 0f 1f 44 00 00 48 bb fd ef ff ff ff 7f 00 00 48 39 d9 73 34 0f 01 cb <89> 01 31 c9 0f 01 ca c3 66 0f 1f 44 00 00 48 bb f9 ef ff ff ff 7f RSP: 0018:ffffc9000461feb0 EFLAGS: 00050297 RAX: 0000000000000002 RBX: 00007fffffffeffd RCX: 0000000020000000 RDX: 0000000000000001 RSI: ffffffff8aec1240 RDI: ffffffff8b3d7940 RBP: 1ffff110046b0037 R08: dffffc0000000000 R09: fffffbfff1ce8ebe R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000020000000 R13: ffff8880235805f8 R14: ffff8880235801b8 R15: ffff88807b5f8780 reiserfs_ioctl+0x14d/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fe19f87cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe1a06950c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe19f99bf80 RCX: 00007fe19f87cb29 RDX: 0000000020000000 RSI: 0000000080087601 RDI: 0000000000000005 RBP: 00007fe19f8c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe19f99bf80 R15: 00007ffc31b37f08 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 39 d9 cmp %rbx,%rcx 5: 73 54 jae 0x5b 7: 0f 01 cb stac a: 66 89 01 mov %ax,(%rcx) d: 31 c9 xor %ecx,%ecx f: 0f 01 ca clac 12: c3 ret 13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 18: 48 bb fd ef ff ff ff movabs $0x7fffffffeffd,%rbx 1f: 7f 00 00 22: 48 39 d9 cmp %rbx,%rcx 25: 73 34 jae 0x5b 27: 0f 01 cb stac * 2a: 89 01 mov %eax,(%rcx) <-- trapping instruction 2c: 31 c9 xor %ecx,%ecx 2e: 0f 01 ca clac 31: c3 ret 32: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 38: 48 rex.W 39: bb f9 ef ff ff mov $0xffffeff9,%ebx 3e: ff (bad) 3f: 7f .byte 0x7f