loop3: detected capacity change from 0 to 2048 NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) ====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc3-syzkaller-00158-gee6050c8af96 #0 Not tainted ------------------------------------------------------ syz-executor.3/32696 is trying to acquire lock: ffff888075af5090 (&nilfs->ns_sem){++++}-{3:3}, at: nilfs_set_error fs/nilfs2/super.c:92 [inline] ffff888075af5090 (&nilfs->ns_sem){++++}-{3:3}, at: __nilfs_error+0x208/0x730 fs/nilfs2/super.c:137 but task is already holding lock: ffff88807bf03870 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x1f7/0x8e0 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+0x1a7/0x400 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+0x2d6/0x6b0 fs/nilfs2/super.c:318 nilfs_put_super+0x96/0x150 fs/nilfs2/super.c:472 generic_shutdown_super+0x130/0x310 fs/super.c:492 kill_block_super+0x79/0xd0 fs/super.c:1428 deactivate_locked_super+0xa7/0xf0 fs/super.c:332 cleanup_mnt+0x494/0x520 fs/namespace.c:1186 task_work_run+0x243/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 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+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 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+0x208/0x730 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/0x8e0 fs/nilfs2/inode.c:85 do_mpage_readpage+0x98b/0x1bb0 fs/mpage.c:208 mpage_readahead+0x210/0x390 fs/mpage.c:361 read_pages+0x17d/0x9d0 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+0x49b/0x1110 mm/filemap.c:2581 filemap_read+0x3e7/0xee0 mm/filemap.c:2675 __kernel_read+0x3c4/0x7e0 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+0x17d1/0x1cb0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x47f/0x8d0 security/integrity/ima/ima_api.c:292 process_measurement+0xd60/0x1b10 security/integrity/ima/ima_main.c:337 ima_file_check+0xe7/0x160 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x2654/0x2e00 fs/namei.c:3713 do_filp_open+0x275/0x500 fs/namei.c:3740 do_sys_openat2+0x13b/0x500 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+0x2b/0x70 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.3/32696: #0: ffff888021747620 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x542/0x1b10 security/integrity/ima/ima_main.c:260 #1: ffff8880331d2450 (mapping.invalidate_lock#8){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:811 [inline] #1: ffff8880331d2450 (mapping.invalidate_lock#8){.+.+}-{3:3}, at: page_cache_ra_unbounded+0xe9/0x820 mm/readahead.c:226 #2: ffff88807bf03870 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x1f7/0x8e0 fs/nilfs2/inode.c:84 stack backtrace: CPU: 1 PID: 32696 Comm: syz-executor.3 Not tainted 6.1.0-rc3-syzkaller-00158-gee6050c8af96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 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+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 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+0x208/0x730 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/0x8e0 fs/nilfs2/inode.c:85 do_mpage_readpage+0x98b/0x1bb0 fs/mpage.c:208 mpage_readahead+0x210/0x390 fs/mpage.c:361 read_pages+0x17d/0x9d0 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+0x49b/0x1110 mm/filemap.c:2581 filemap_read+0x3e7/0xee0 mm/filemap.c:2675 __kernel_read+0x3c4/0x7e0 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+0x17d1/0x1cb0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x47f/0x8d0 security/integrity/ima/ima_api.c:292 process_measurement+0xd60/0x1b10 security/integrity/ima/ima_main.c:337 ima_file_check+0xe7/0x160 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x2654/0x2e00 fs/namei.c:3713 do_filp_open+0x275/0x500 fs/namei.c:3740 do_sys_openat2+0x13b/0x500 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+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f33e0a8b5a9 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:00007f33e182c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f33e0babf80 RCX: 00007f33e0a8b5a9 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000020000880 RBP: 00007f33e0ae67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff42ef091f R14: 00007f33e182c300 R15: 0000000000022000 Remounting filesystem read-only NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) syz-executor.3 (32696) used greatest stack depth: 18424 bytes left