====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc4-syzkaller-00021-gca91b9500108 #0 Not tainted ------------------------------------------------------ syz.4.142/7333 is trying to acquire lock: ffff8880206e0090 (&nilfs->ns_sem){++++}-{4:4}, at: nilfs_set_error fs/nilfs2/super.c:92 [inline] ffff8880206e0090 (&nilfs->ns_sem){++++}-{4:4}, at: __nilfs_error+0x1ca/0x4b0 fs/nilfs2/super.c:141 but task is already holding lock: ffff8880249e1870 (&dat_lock_key){.+.+}-{4:4}, at: __nilfs_read_inode fs/nilfs2/inode.c:452 [inline] ffff8880249e1870 (&dat_lock_key){.+.+}-{4:4}, at: nilfs_iget+0x1ce/0x810 fs/nilfs2/inode.c:564 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&dat_lock_key){.+.+}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1524 nilfs_get_block+0x1b1/0x8f0 fs/nilfs2/inode.c:83 do_mpage_readpage+0x86d/0x19a0 fs/mpage.c:222 mpage_readahead+0x398/0x650 fs/mpage.c:371 read_pages+0x177/0x590 mm/readahead.c:160 page_cache_ra_unbounded+0x346/0x7b0 mm/readahead.c:264 do_sync_mmap_readahead+0x4b5/0x5f0 mm/filemap.c:3262 filemap_fault+0x62a/0x1200 mm/filemap.c:3403 __do_fault+0x135/0x390 mm/memory.c:5098 do_shared_fault mm/memory.c:5582 [inline] do_fault mm/memory.c:5656 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x17f9/0x5380 mm/memory.c:6140 handle_mm_fault+0x2d5/0x7f0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #4 (mapping.invalidate_lock#3){.+.+}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:922 [inline] filemap_fault+0x546/0x1200 mm/filemap.c:3391 __do_fault+0x135/0x390 mm/memory.c:5098 do_shared_fault mm/memory.c:5582 [inline] do_fault mm/memory.c:5656 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x17f9/0x5380 mm/memory.c:6140 handle_mm_fault+0x2d5/0x7f0 mm/memory.c:6309 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1337 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #3 (vm_lock){++++}-{0:0}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __vma_enter_locked+0x182/0x380 mm/memory.c:6473 __vma_start_write+0x1e/0x120 mm/memory.c:6497 vma_start_write include/linux/mm.h:829 [inline] mprotect_fixup+0x571/0x9b0 mm/mprotect.c:670 setup_arg_pages+0x53a/0xaa0 fs/exec.c:780 load_elf_binary+0xb7a/0x27b0 fs/binfmt_elf.c:1019 search_binary_handler fs/exec.c:1778 [inline] exec_binprm fs/exec.c:1810 [inline] bprm_execve+0x999/0x1440 fs/exec.c:1862 kernel_execve+0x8f0/0x9f0 fs/exec.c:2028 try_to_run_init_process+0x13/0x60 init/main.c:1385 kernel_init+0xad/0x1d0 init/main.c:1513 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #2 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __might_fault+0xcc/0x130 mm/memory.c:7151 _copy_to_iter+0xf3/0x15a0 lib/iov_iter.c:184 copy_page_to_iter+0xa7/0x150 lib/iov_iter.c:362 copy_folio_to_iter include/linux/uio.h:198 [inline] filemap_read+0x78d/0x11d0 mm/filemap.c:2753 blkdev_read_iter+0x30a/0x440 block/fops.c:809 new_sync_read fs/read_write.c:489 [inline] vfs_read+0x4cd/0x980 fs/read_write.c:570 ksys_read+0x145/0x250 fs/read_write.c:713 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&sb->s_type->i_mutex_key#7){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:867 [inline] set_blocksize+0x23b/0x500 block/bdev.c:203 sb_set_blocksize block/bdev.c:224 [inline] sb_min_blocksize+0x119/0x210 block/bdev.c:239 init_nilfs+0x43/0x690 fs/nilfs2/the_nilfs.c:710 nilfs_fill_super+0x8f/0x650 fs/nilfs2/super.c:1060 nilfs_get_tree+0x4f4/0x870 fs/nilfs2/super.c:1228 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&nilfs->ns_sem){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0x1ca/0x4b0 fs/nilfs2/super.c:141 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_at_level+0x34e/0x3d0 fs/nilfs2/bmap.c:88 nilfs_bmap_lookup fs/nilfs2/bmap.h:182 [inline] nilfs_mdt_submit_block+0x3a3/0x830 fs/nilfs2/mdt.c:144 nilfs_mdt_read_block+0xad/0x320 fs/nilfs2/mdt.c:188 nilfs_mdt_get_block+0x11f/0xab0 fs/nilfs2/mdt.c:254 nilfs_palloc_get_block+0x18d/0x2b0 fs/nilfs2/alloc.c:239 nilfs_palloc_get_entry_block+0x8c/0xa0 fs/nilfs2/alloc.c:355 nilfs_ifile_get_inode_block+0xf0/0x190 fs/nilfs2/ifile.c:137 __nilfs_read_inode fs/nilfs2/inode.c:453 [inline] nilfs_iget+0x201/0x810 fs/nilfs2/inode.c:564 nilfs_get_root_dentry+0x28/0x230 fs/nilfs2/super.c:915 nilfs_fill_super+0x47f/0x650 fs/nilfs2/super.c:1098 nilfs_get_tree+0x4f4/0x870 fs/nilfs2/super.c:1228 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &nilfs->ns_sem --> mapping.invalidate_lock#3 --> &dat_lock_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&dat_lock_key); lock(mapping.invalidate_lock#3); lock(&dat_lock_key); lock(&nilfs->ns_sem); *** DEADLOCK *** 2 locks held by syz.4.142/7333: #0: ffff888079dc00e0 (&type->s_umount_key#64/1){+.+.}-{4:4}, at: alloc_super+0x204/0x970 fs/super.c:344 #1: ffff8880249e1870 (&dat_lock_key){.+.+}-{4:4}, at: __nilfs_read_inode fs/nilfs2/inode.c:452 [inline] #1: ffff8880249e1870 (&dat_lock_key){.+.+}-{4:4}, at: nilfs_iget+0x1ce/0x810 fs/nilfs2/inode.c:564 stack backtrace: CPU: 0 UID: 0 PID: 7333 Comm: syz.4.142 Not tainted 6.15.0-rc4-syzkaller-00021-gca91b9500108 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2079 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0x1ca/0x4b0 fs/nilfs2/super.c:141 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_at_level+0x34e/0x3d0 fs/nilfs2/bmap.c:88 nilfs_bmap_lookup fs/nilfs2/bmap.h:182 [inline] nilfs_mdt_submit_block+0x3a3/0x830 fs/nilfs2/mdt.c:144 nilfs_mdt_read_block+0xad/0x320 fs/nilfs2/mdt.c:188 nilfs_mdt_get_block+0x11f/0xab0 fs/nilfs2/mdt.c:254 nilfs_palloc_get_block+0x18d/0x2b0 fs/nilfs2/alloc.c:239 nilfs_palloc_get_entry_block+0x8c/0xa0 fs/nilfs2/alloc.c:355 nilfs_ifile_get_inode_block+0xf0/0x190 fs/nilfs2/ifile.c:137 __nilfs_read_inode fs/nilfs2/inode.c:453 [inline] nilfs_iget+0x201/0x810 fs/nilfs2/inode.c:564 nilfs_get_root_dentry+0x28/0x230 fs/nilfs2/super.c:915 nilfs_fill_super+0x47f/0x650 fs/nilfs2/super.c:1098 nilfs_get_tree+0x4f4/0x870 fs/nilfs2/super.c:1228 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5b8539010a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5b8625fe68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f5b8625fef0 RCX: 00007f5b8539010a RDX: 0000200000000000 RSI: 0000200000000100 RDI: 00007f5b8625feb0 RBP: 0000200000000000 R08: 00007f5b8625fef0 R09: 000000000001480c R10: 000000000001480c R11: 0000000000000246 R12: 0000200000000100 R13: 00007f5b8625feb0 R14: 0000000000000a70 R15: 0000200000000380 Remounting filesystem read-only NILFS error (device loop4): nilfs_check_folio: bad entry in directory #2: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0