NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) ====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc3-syzkaller-00332-g089d1c31224e #0 Not tainted ------------------------------------------------------ syz-executor.2/14334 is trying to acquire lock: ffff88802e3fc090 (&nilfs->ns_sem){++++}-{3:3}, at: nilfs_set_error fs/nilfs2/super.c:92 [inline] ffff88802e3fc090 (&nilfs->ns_sem){++++}-{3:3}, at: __nilfs_error+0x1d2/0x4c0 fs/nilfs2/super.c:137 but task is already holding lock: ffff88804b4a9070 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x1f7/0x8d0 fs/nilfs2/inode.c:84 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&dat_lock_key){.+.+}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_read+0x39/0x50 kernel/locking/rwsem.c:1509 nilfs_count_free_blocks+0x63/0x110 fs/nilfs2/the_nilfs.c:693 nilfs_set_log_cursor fs/nilfs2/super.c:236 [inline] nilfs_cleanup_super+0x11e/0x410 fs/nilfs2/super.c:318 load_nilfs+0x8fe/0xfc0 fs/nilfs2/the_nilfs.c:315 nilfs_fill_super+0x27e/0x5d0 fs/nilfs2/super.c:1059 nilfs_mount+0x613/0x9b0 fs/nilfs2/super.c:1317 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1531 do_new_mount+0x289/0xad0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&nilfs->ns_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write+0x9c/0x270 kernel/locking/rwsem.c:1562 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0x1d2/0x4c0 fs/nilfs2/super.c:137 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_contig+0x132/0x150 fs/nilfs2/bmap.c:95 nilfs_get_block+0x240/0x8d0 fs/nilfs2/inode.c:85 do_mpage_readpage+0x970/0x1c50 fs/mpage.c:208 mpage_readahead+0x210/0x380 fs/mpage.c:361 read_pages+0x169/0x9c0 mm/readahead.c:161 page_cache_ra_unbounded+0x703/0x820 mm/readahead.c:270 page_cache_sync_readahead include/linux/pagemap.h:1213 [inline] filemap_get_pages+0x465/0x10d0 mm/filemap.c:2581 filemap_read+0x3cf/0xea0 mm/filemap.c:2675 __kernel_read+0x3fc/0x830 fs/read_write.c:428 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:199 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x178f/0x1ca0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x444/0x8c0 security/integrity/ima/ima_api.c:292 process_measurement+0xf4b/0x1bd0 security/integrity/ima/ima_main.c:337 ima_file_check+0xd8/0x130 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x2642/0x2df0 fs/namei.c:3713 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_open fs/open.c:1334 [inline] __se_sys_open fs/open.c:1330 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1330 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&dat_lock_key); lock(&nilfs->ns_sem); lock(&dat_lock_key); lock(&nilfs->ns_sem); *** DEADLOCK *** 3 locks held by syz-executor.2/14334: #0: ffff888077cf8740 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x7ab/0x1bd0 security/integrity/ima/ima_main.c:260 #1: ffff888036575790 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:811 [inline] #1: ffff888036575790 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: page_cache_ra_unbounded+0xe9/0x820 mm/readahead.c:226 #2: ffff88804b4a9070 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x1f7/0x8d0 fs/nilfs2/inode.c:84 stack backtrace: CPU: 1 PID: 14334 Comm: syz-executor.2 Not tainted 6.1.0-rc3-syzkaller-00332-g089d1c31224e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write+0x9c/0x270 kernel/locking/rwsem.c:1562 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0x1d2/0x4c0 fs/nilfs2/super.c:137 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_contig+0x132/0x150 fs/nilfs2/bmap.c:95 nilfs_get_block+0x240/0x8d0 fs/nilfs2/inode.c:85 do_mpage_readpage+0x970/0x1c50 fs/mpage.c:208 mpage_readahead+0x210/0x380 fs/mpage.c:361 read_pages+0x169/0x9c0 mm/readahead.c:161 page_cache_ra_unbounded+0x703/0x820 mm/readahead.c:270 page_cache_sync_readahead include/linux/pagemap.h:1213 [inline] filemap_get_pages+0x465/0x10d0 mm/filemap.c:2581 filemap_read+0x3cf/0xea0 mm/filemap.c:2675 __kernel_read+0x3fc/0x830 fs/read_write.c:428 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:199 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x178f/0x1ca0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x444/0x8c0 security/integrity/ima/ima_api.c:292 process_measurement+0xf4b/0x1bd0 security/integrity/ima/ima_main.c:337 ima_file_check+0xd8/0x130 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x2642/0x2df0 fs/namei.c:3713 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_open fs/open.c:1334 [inline] __se_sys_open fs/open.c:1330 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1330 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0b8808b5a9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007f0b873ff168 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f0b881ac050 RCX: 00007f0b8808b5a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f0b880e67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff7c14d78f R14: 00007f0b873ff300 R15: 0000000000022000 Remounting filesystem read-only NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop2): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop2): nilfs_bmap_lookup_contig: broken bmap (inode number=16) syz-executor.2 (14334) used greatest stack depth: 12632 bytes left