audit: type=1800 audit(1666345151.767:17): pid=9931 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed" comm="syz-executor.5" name="file2" dev="loop5" ino=16 res=0 NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds ====================================================== WARNING: possible circular locking dependency detected 4.14.295-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/7995 is trying to acquire lock: (&dat_lock_key){.+.+}, at: [] nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:707 but task is already holding lock: (&nilfs->ns_sem){++++}, at: [] nilfs_put_super+0x139/0x190 fs/nilfs2/super.c:482 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&nilfs->ns_sem){++++}: down_write+0x34/0x90 kernel/locking/rwsem.c:54 nilfs_set_error fs/nilfs2/super.c:95 [inline] __nilfs_error+0x176/0x399 fs/nilfs2/super.c:140 nilfs_bmap_convert_error fs/nilfs2/bmap.c:44 [inline] nilfs_bmap_lookup_contig+0x130/0x170 fs/nilfs2/bmap.c:104 nilfs_get_block+0x1bd/0x7a0 fs/nilfs2/inode.c:89 do_mpage_readpage+0x615/0x1470 fs/mpage.c:211 mpage_readpages+0x2d6/0x5f0 fs/mpage.c:383 read_pages mm/readahead.c:121 [inline] __do_page_cache_readahead+0x522/0x940 mm/readahead.c:199 ra_submit mm/internal.h:66 [inline] ondemand_readahead.isra.0+0x514/0xb60 mm/readahead.c:486 page_cache_sync_readahead mm/readahead.c:518 [inline] page_cache_sync_readahead+0xa6/0xf0 mm/readahead.c:503 generic_file_buffered_read mm/filemap.c:2003 [inline] generic_file_read_iter+0xfbc/0x21c0 mm/filemap.c:2273 call_read_iter include/linux/fs.h:1774 [inline] new_sync_read fs/read_write.c:401 [inline] __vfs_read+0x449/0x620 fs/read_write.c:413 integrity_kernel_read+0x11b/0x1b0 security/integrity/iint.c:199 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:381 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:410 [inline] ima_calc_file_hash+0x3ee/0x780 security/integrity/ima/ima_crypto.c:467 ima_collect_measurement+0x39d/0x430 security/integrity/ima/ima_api.c:227 process_measurement+0x78b/0xb20 security/integrity/ima/ima_main.c:264 do_last fs/namei.c:3435 [inline] path_openat+0x10ad/0x2970 fs/namei.c:3571 do_filp_open+0x179/0x3c0 fs/namei.c:3605 do_sys_open+0x296/0x410 fs/open.c:1081 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #0 (&dat_lock_key){.+.+}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 down_read+0x36/0x80 kernel/locking/rwsem.c:24 nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:707 nilfs_set_log_cursor fs/nilfs2/super.c:247 [inline] nilfs_cleanup_super+0x123/0x450 fs/nilfs2/super.c:329 nilfs_put_super+0x141/0x190 fs/nilfs2/super.c:483 generic_shutdown_super+0x144/0x370 fs/super.c:446 kill_block_super+0x95/0xe0 fs/super.c:1161 deactivate_locked_super+0x6c/0xd0 fs/super.c:319 deactivate_super+0x7f/0xa0 fs/super.c:350 cleanup_mnt+0x186/0x2c0 fs/namespace.c:1183 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&nilfs->ns_sem); lock(&dat_lock_key); lock(&nilfs->ns_sem); lock(&dat_lock_key); *** DEADLOCK *** 2 locks held by syz-executor.0/7995: #0: (&type->s_umount_key#50){+.+.}, at: [] deactivate_super+0x77/0xa0 fs/super.c:349 #1: (&nilfs->ns_sem){++++}, at: [] nilfs_put_super+0x139/0x190 fs/nilfs2/super.c:482 stack backtrace: CPU: 0 PID: 7995 Comm: syz-executor.0 Not tainted 4.14.295-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 down_read+0x36/0x80 kernel/locking/rwsem.c:24 nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:707 nilfs_set_log_cursor fs/nilfs2/super.c:247 [inline] nilfs_cleanup_super+0x123/0x450 fs/nilfs2/super.c:329 nilfs_put_super+0x141/0x190 fs/nilfs2/super.c:483 generic_shutdown_super+0x144/0x370 fs/super.c:446 kill_block_super+0x95/0xe0 fs/super.c:1161 deactivate_locked_super+0x6c/0xd0 fs/super.c:319 deactivate_super+0x7f/0xa0 fs/super.c:350 cleanup_mnt+0x186/0x2c0 fs/namespace.c:1183 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f2b7823ea17 RSP: 002b:00007ffd5c75d2b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f2b7823ea17 RDX: 00007ffd5c75d38a RSI: 000000000000000a RDI: 00007ffd5c75d380 RBP: 00007ffd5c75d380 R08: 00000000ffffffff R09: 00007ffd5c75d150 R10: 0000555555d0c903 R11: 0000000000000246 R12: 00007f2b782975f6 R13: 00007ffd5c75e440 R14: 0000555555d0c810 R15: 00007ffd5c75e480 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) Remounting filesystem read-only NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 Remounting filesystem read-only NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) audit: type=1800 audit(1666345153.977:18): pid=10000 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.3" name="bus" dev="sda1" ino=13989 res=0 UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) audit: type=1800 audit(1666345154.277:19): pid=9955 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed" comm="syz-executor.5" name="file2" dev="loop5" ino=16 res=0 NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) NILFS (loop0): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop0): nilfs_bmap_lookup_contig: broken bmap (inode number=16) audit: type=1800 audit(1666345154.407:20): pid=9985 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed" comm="syz-executor.0" name="file2" dev="loop0" ino=16 res=0 UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) ====================================================== WARNING: the mand mount option is being deprecated and will be removed in v5.15! ====================================================== UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000) overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value overlayfs: unrecognized mount option "xino=off" or missing value (syz-executor.5,10381,1):ocfs2_parse_options:1498 ERROR: Invalid heartbeat mount options (syz-executor.5,10381,1):ocfs2_fill_super:1217 ERROR: status = -22 (syz-executor.5,10426,0):ocfs2_parse_options:1498 ERROR: Invalid heartbeat mount options (syz-executor.5,10426,0):ocfs2_fill_super:1217 ERROR: status = -22 (syz-executor.5,10459,1):ocfs2_parse_options:1498 ERROR: Invalid heartbeat mount options FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) (syz-executor.5,10459,1):ocfs2_fill_super:1217 ERROR: status = -22 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) audit: type=1804 audit(1666345162.228:21): pid=10493 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir456256739/syzkaller.Aw5j08/38/bus" dev="sda1" ino=14034 res=1 (syz-executor.5,10495,1):ocfs2_parse_options:1498 ERROR: Invalid heartbeat mount options FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) (syz-executor.5,10495,1):ocfs2_fill_super:1217 ERROR: status = -22 audit: type=1800 audit(1666345162.258:22): pid=10493 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14034 res=0 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) audit: type=1804 audit(1666345162.318:23): pid=10508 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.2" name="/root/syzkaller-testdir456256739/syzkaller.Aw5j08/38/bus" dev="sda1" ino=14034 res=1 audit: type=1800 audit(1666345162.318:24): pid=10508 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14034 res=0 audit: type=1804 audit(1666345162.428:25): pid=10523 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir456256739/syzkaller.Aw5j08/39/bus" dev="sda1" ino=14004 res=1 audit: type=1800 audit(1666345162.428:26): pid=10523 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14004 res=0 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) audit: type=1804 audit(1666345162.468:27): pid=10532 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir2586904477/syzkaller.UnJ6F3/46/bus" dev="sda1" ino=14015 res=1 audit: type=1800 audit(1666345162.468:28): pid=10532 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=14015 res=0 audit: type=1804 audit(1666345162.478:29): pid=10533 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.2" name="/root/syzkaller-testdir456256739/syzkaller.Aw5j08/39/bus" dev="sda1" ino=14004 res=1 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) audit: type=1800 audit(1666345162.478:30): pid=10533 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14004 res=0