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 6.1.114-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/1940 is trying to acquire lock: ffff888100fae890 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x1b/0x40 fs/reiserfs/lock.c:78 but task is already holding lock: ffff88810c64c170 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] ffff88810c64c170 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x59/0x230 mm/readahead.c:226 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (mapping.invalidate_lock#3){.+.+}-{3:3}: down_read+0x46/0x430 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] page_cache_ra_unbounded+0x59/0x230 mm/readahead.c:226 do_sync_mmap_readahead+0x134/0x260 filemap_fault+0x1c5/0x660 mm/filemap.c:3227 __do_fault+0x38/0x100 mm/memory.c:4278 do_shared_fault mm/memory.c:4684 [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+0xe1f/0x1920 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+0x26b/0x540 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+0x8a/0x130 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x6a/0xb0 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x146d/0x2830 kernel/locking/lockdep.c:5049 lock_acquire+0xe3/0x270 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x970 kernel/locking/mutex.c:747 reiserfs_write_lock_nested+0x1b/0x40 fs/reiserfs/lock.c:78 reiserfs_cond_resched fs/reiserfs/reiserfs.h:849 [inline] search_by_key+0x395/0x1020 fs/reiserfs/stree.c:712 search_for_position_by_key+0xc8/0x2a0 fs/reiserfs/stree.c:874 _get_block_create_0+0x142/0x6c0 fs/reiserfs/inode.c:305 reiserfs_get_block+0x1c4/0x1320 fs/reiserfs/inode.c:695 do_mpage_readpage+0x272/0x760 fs/mpage.c:208 mpage_readahead+0x13a/0x230 fs/mpage.c:361 read_pages+0x7d/0x1f0 mm/readahead.c:161 page_cache_ra_unbounded+0x1d6/0x230 mm/readahead.c:270 do_sync_mmap_readahead+0x134/0x260 filemap_fault+0x1c5/0x660 mm/filemap.c:3227 __do_fault+0x38/0x100 mm/memory.c:4278 do_shared_fault mm/memory.c:4684 [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+0xe1f/0x1920 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+0x26b/0x540 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+0x8a/0x130 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x6a/0xb0 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 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/1940: #0: ffff88810c64c170 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] #0: ffff88810c64c170 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x59/0x230 mm/readahead.c:226 stack backtrace: CPU: 1 PID: 1940 Comm: syz-executor.0 Not tainted 6.1.114-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+0x89/0xd7 lib/dump_stack.c:106 print_circular_bug+0x2c5/0x300 kernel/locking/lockdep.c:2048 check_noncircular+0x106/0x110 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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x146d/0x2830 kernel/locking/lockdep.c:5049 lock_acquire+0xe3/0x270 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x970 kernel/locking/mutex.c:747 reiserfs_write_lock_nested+0x1b/0x40 fs/reiserfs/lock.c:78 reiserfs_cond_resched fs/reiserfs/reiserfs.h:849 [inline] search_by_key+0x395/0x1020 fs/reiserfs/stree.c:712 search_for_position_by_key+0xc8/0x2a0 fs/reiserfs/stree.c:874 _get_block_create_0+0x142/0x6c0 fs/reiserfs/inode.c:305 reiserfs_get_block+0x1c4/0x1320 fs/reiserfs/inode.c:695 do_mpage_readpage+0x272/0x760 fs/mpage.c:208 mpage_readahead+0x13a/0x230 fs/mpage.c:361 read_pages+0x7d/0x1f0 mm/readahead.c:161 page_cache_ra_unbounded+0x1d6/0x230 mm/readahead.c:270 do_sync_mmap_readahead+0x134/0x260 filemap_fault+0x1c5/0x660 mm/filemap.c:3227 __do_fault+0x38/0x100 mm/memory.c:4278 do_shared_fault mm/memory.c:4684 [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+0xe1f/0x1920 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+0x26b/0x540 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:ffffc900026ebec0 EFLAGS: 00050297 RAX: 0000000000000002 RBX: 00007fffffffeffd RCX: 0000000020000000 RDX: 000000000502aa01 RSI: 0000000000000060 RDI: ffffffff8300f60d RBP: 0000000080087601 R08: ffff888101ac1c40 R09: 0000000000000000 R10: 0000000000000000 R11: 0000001000000000 R12: ffff888100e40c00 R13: 0000000000000005 R14: ffff88810c64be80 R15: 0000000020000000 reiserfs_ioctl+0x8a/0x130 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x6a/0xb0 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f639d27cb29 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:00007f639dfb60c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f639d39bf80 RCX: 00007f639d27cb29 RDX: 0000000020000000 RSI: 0000000080087601 RDI: 0000000000000005 RBP: 00007f639d2c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000006 R14: 00007f639d39bf80 R15: 00007ffcd45bda58 syz-executor.0 (1940) used greatest stack depth: 10432 bytes left ---------------- 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