REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor378/5057 is trying to acquire lock: ffff88807afc7090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27 but task is already holding lock: ffff88801ece2510 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2943 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1635 [inline] sb_start_pagefault include/linux/fs.h:1739 [inline] filemap_page_mkwrite+0x16f/0x640 mm/filemap.c:3577 do_page_mkwrite+0x197/0x470 mm/memory.c:2943 do_shared_fault mm/memory.c:4704 [inline] do_fault mm/memory.c:4766 [inline] do_pte_missing mm/memory.c:3730 [inline] handle_pte_fault mm/memory.c:5038 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x22d4/0x6650 mm/memory.c:5344 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:65 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline] copy_to_user_iter lib/iov_iter.c:25 [inline] iterate_ubuf include/linux/iov_iter.h:29 [inline] iterate_and_advance2 include/linux/iov_iter.h:245 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x257/0x1ce0 lib/iov_iter.c:186 copy_page_to_iter+0xb1/0x160 lib/iov_iter.c:381 copy_folio_to_iter include/linux/uio.h:181 [inline] filemap_read+0x876/0x10b0 mm/filemap.c:2644 call_read_iter include/linux/fs.h:2014 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x78b/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 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 -> #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] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x191/0x1b0 fs/inode.c:2172 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2943 do_shared_fault mm/memory.c:4704 [inline] do_fault mm/memory.c:4766 [inline] do_pte_missing mm/memory.c:3730 [inline] handle_pte_fault mm/memory.c:5038 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x22d4/0x6650 mm/memory.c:5344 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:65 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline] copy_to_user_iter lib/iov_iter.c:25 [inline] iterate_ubuf include/linux/iov_iter.h:29 [inline] iterate_and_advance2 include/linux/iov_iter.h:245 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x257/0x1ce0 lib/iov_iter.c:186 copy_page_to_iter+0xb1/0x160 lib/iov_iter.c:381 copy_folio_to_iter include/linux/uio.h:181 [inline] filemap_read+0x876/0x10b0 mm/filemap.c:2644 call_read_iter include/linux/fs.h:2014 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x78b/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 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: Chain exists of: &sbi->lock --> &mm->mmap_lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults); lock(&mm->mmap_lock); lock(sb_pagefaults); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor378/5057: #0: ffff888078901e20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #0: ffff888078901e20 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5371 [inline] #0: ffff888078901e20 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x2d0 mm/memory.c:5431 #1: ffff88801ece2510 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x197/0x470 mm/memory.c:2943 stack backtrace: CPU: 1 PID: 5057 Comm: syz-executor378 Not tainted 6.7.0-rc1-syzkaller #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] __file_update_time fs/inode.c:2142 [inline] file_update_time+0x191/0x1b0 fs/inode.c:2172 filemap_page_mkwrite+0x27b/0x640 mm/filemap.c:3578 do_page_mkwrite+0x197/0x470 mm/memory.c:2943 do_shared_fault mm/memory.c:4704 [inline] do_fault mm/memory.c:4766 [inline] do_pte_missing mm/memory.c:3730 [inline] handle_pte_fault mm/memory.c:5038 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0x22d4/0x6650 mm/memory.c:5344 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2ac/0x860 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:71 Code: 75 f1 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 df 83 f9 08 73 e8 eb c9 a4 c3 48 89 c8 48 c1 e9 03 83 e0 07 f3 48 a5 89 c1 85 c9 75 b3 RSP: 0018:ffffc90003cdf8f8 EFLAGS: 00050206 RAX: ffffffff84825701 RBX: 0000000020001740 RCX: 0000000000001000 RDX: 0000000000000000 RSI: ffff888012a8c000 RDI: 0000000020001740 RBP: ffffc90003cdfa78 R08: ffff888012a8cfff R09: 1ffff110025519ff R10: dffffc0000000000 R11: ffffed1002551a00 R12: 0000000000001000 R13: ffff888012a8c000 R14: ffffc90003cdfd98 R15: 1ffff9200079bfb3 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline] copy_to_user_iter lib/iov_iter.c:25 [inline] iterate_ubuf include/linux/iov_iter.h:29 [inline] iterate_and_advance2 include/linux/iov_iter.h:245 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x257/0x1ce0 lib/iov_iter.c:186 copy_page_to_iter+0xb1/0x160 lib/iov_iter.c:381 copy_folio_to_iter include/linux/uio.h:181 [inline] filemap_read+0x876/0x10b0 mm/filemap.c:2644 call_read_iter include/linux/fs.h:2014 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x78b/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 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:0x7f815d0cdc79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffeef630378 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffff ---------------- Code disassembly (best guess): 0: 75 f1 jne 0xfffffff3 2: c3 ret 3: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) a: 00 00 00 d: 0f 1f 00 nopl (%rax) 10: 48 8b 06 mov (%rsi),%rax 13: 48 89 07 mov %rax,(%rdi) 16: 48 83 c6 08 add $0x8,%rsi 1a: 48 83 c7 08 add $0x8,%rdi 1e: 83 e9 08 sub $0x8,%ecx 21: 74 df je 0x2 23: 83 f9 08 cmp $0x8,%ecx 26: 73 e8 jae 0x10 28: eb c9 jmp 0xfffffff3 * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: c3 ret 2d: 48 89 c8 mov %rcx,%rax 30: 48 c1 e9 03 shr $0x3,%rcx 34: 83 e0 07 and $0x7,%eax 37: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) 3a: 89 c1 mov %eax,%ecx 3c: 85 c9 test %ecx,%ecx 3e: 75 b3 jne 0xfffffff3