REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): using 3.5.x disk format REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 5.15.173-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/4103 is trying to acquire lock: ffff8880195db090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x5b/0xd0 fs/reiserfs/lock.c:78 but task is already holding lock: ffff88806f86e140 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] ffff88806f86e140 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (mapping.invalidate_lock#3){.+.+}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996 filemap_fault+0x77a/0x1470 mm/filemap.c:3089 __do_fault+0x139/0x340 mm/memory.c:3926 do_shared_fault mm/memory.c:4316 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x275d/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 __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:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 reiserfs_write_lock_nested+0x5b/0xd0 fs/reiserfs/lock.c:78 reiserfs_cond_resched fs/reiserfs/reiserfs.h:849 [inline] search_by_key+0x9e6/0x4730 fs/reiserfs/stree.c:712 search_for_position_by_key+0x109/0x1010 fs/reiserfs/stree.c:874 _get_block_create_0+0x2fa/0x2220 fs/reiserfs/inode.c:305 reiserfs_get_block+0x39b/0x5390 fs/reiserfs/inode.c:703 do_mpage_readpage+0x6c8/0x1f70 fs/mpage.c:231 mpage_readahead+0x427/0x9b0 fs/mpage.c:389 read_pages+0x159/0x8e0 mm/readahead.c:130 page_cache_ra_unbounded+0x7b0/0x930 mm/readahead.c:239 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996 filemap_fault+0x77a/0x1470 mm/filemap.c:3089 __do_fault+0x139/0x340 mm/memory.c:3926 do_shared_fault mm/memory.c:4316 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x275d/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 __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:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(mapping.invalidate_lock#3); lock(&sbi->lock); lock(mapping.invalidate_lock#3); lock(&sbi->lock); *** DEADLOCK *** 1 lock held by syz-executor.0/4103: #0: ffff88806f86e140 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] #0: ffff88806f86e140 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195 stack backtrace: CPU: 0 PID: 4103 Comm: syz-executor.0 Not tainted 5.15.173-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/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 reiserfs_write_lock_nested+0x5b/0xd0 fs/reiserfs/lock.c:78 reiserfs_cond_resched fs/reiserfs/reiserfs.h:849 [inline] search_by_key+0x9e6/0x4730 fs/reiserfs/stree.c:712 search_for_position_by_key+0x109/0x1010 fs/reiserfs/stree.c:874 _get_block_create_0+0x2fa/0x2220 fs/reiserfs/inode.c:305 reiserfs_get_block+0x39b/0x5390 fs/reiserfs/inode.c:703 do_mpage_readpage+0x6c8/0x1f70 fs/mpage.c:231 mpage_readahead+0x427/0x9b0 fs/mpage.c:389 read_pages+0x159/0x8e0 mm/readahead.c:130 page_cache_ra_unbounded+0x7b0/0x930 mm/readahead.c:239 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996 filemap_fault+0x77a/0x1470 mm/filemap.c:3089 __do_fault+0x139/0x340 mm/memory.c:3926 do_shared_fault mm/memory.c:4316 [inline] do_fault mm/memory.c:4394 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4783 [inline] handle_mm_fault+0x275d/0x5960 mm/memory.c:4881 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 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:ffffc9000120feb0 EFLAGS: 00050297 RAX: 0000000000000002 RBX: 00007fffffffeffd RCX: 0000000020000000 RDX: 0000000000000001 RSI: ffffffff8a8b3ca0 RDI: ffffffff8ad904c0 RBP: 1ffff1100df0dbcf R08: dffffc0000000000 R09: fffffbfff1bca036 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000020000000 R13: ffff88806f86e2b8 R14: ffff88806f86de78 R15: ffff8880765c1900 reiserfs_ioctl+0x14d/0x340 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fbacc99db29 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:00007fbacbd1f0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fbaccabcf80 RCX: 00007fbacc99db29 RDX: 0000000020000000 RSI: 0000000080087601 RDI: 0000000000000005 RBP: 00007fbacc9e947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fbaccabcf80 R15: 00007ffc11c98b88 ---------------- 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