audit: type=1800 audit(1667211913.148:16): pid=13655 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.1" name="file2" dev="loop1" ino=16 res=0 NILFS (loop5): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop1): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/8155 is trying to acquire lock: 00000000ff87183e (&dat_lock_key){.+.+}, at: nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:698 but task is already holding lock: 000000006c3ca36f (&nilfs->ns_sem){++++}, at: nilfs_put_super+0x14a/0x1a0 fs/nilfs2/super.c:472 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&nilfs->ns_sem){++++}: nilfs_set_error fs/nilfs2/super.c:86 [inline] __nilfs_error+0x195/0x401 fs/nilfs2/super.c:131 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_contig+0x13d/0x180 fs/nilfs2/bmap.c:95 nilfs_get_block+0x1ce/0x970 fs/nilfs2/inode.c:80 do_mpage_readpage+0x8fb/0x1ca0 fs/mpage.c:231 mpage_readpages+0x33a/0x630 fs/mpage.c:404 read_pages.isra.0+0xf6/0x5d0 mm/readahead.c:123 __do_page_cache_readahead+0x5c6/0x6c0 mm/readahead.c:211 ra_submit mm/internal.h:66 [inline] ondemand_readahead.isra.0+0x575/0xd40 mm/readahead.c:493 page_cache_sync_readahead mm/readahead.c:528 [inline] page_cache_sync_readahead+0x275/0x520 mm/readahead.c:510 generic_file_buffered_read mm/filemap.c:2115 [inline] generic_file_read_iter+0x1497/0x2b60 mm/filemap.c:2385 call_read_iter include/linux/fs.h:1815 [inline] new_sync_read fs/read_write.c:406 [inline] __vfs_read+0x518/0x750 fs/read_write.c:418 integrity_kernel_read+0x147/0x1f0 security/integrity/iint.c:200 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:364 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:393 [inline] ima_calc_file_hash+0x4b2/0x8a0 security/integrity/ima/ima_crypto.c:450 ima_collect_measurement+0x4c4/0x570 security/integrity/ima/ima_api.c:231 process_measurement+0xddd/0x1440 security/integrity/ima/ima_main.c:284 ima_file_check+0xb9/0x100 security/integrity/ima/ima_main.c:391 do_last fs/namei.c:3425 [inline] path_openat+0x7e4/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&dat_lock_key){.+.+}: down_read+0x36/0x80 kernel/locking/rwsem.c:24 nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:698 nilfs_set_log_cursor fs/nilfs2/super.c:237 [inline] nilfs_cleanup_super+0x133/0x490 fs/nilfs2/super.c:319 nilfs_put_super+0x152/0x1a0 fs/nilfs2/super.c:473 generic_shutdown_super+0x144/0x370 fs/super.c:456 kill_block_super+0x97/0xf0 fs/super.c:1185 deactivate_locked_super+0x94/0x160 fs/super.c:329 deactivate_super+0x174/0x1a0 fs/super.c:360 cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) 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.1/8155: #0: 00000000078f0d9c (&type->s_umount_key#80){+.+.}, at: deactivate_super+0x16c/0x1a0 fs/super.c:359 #1: 000000006c3ca36f (&nilfs->ns_sem){++++}, at: nilfs_put_super+0x14a/0x1a0 fs/nilfs2/super.c:472 Remounting filesystem read-only stack backtrace: CPU: 1 PID: 8155 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2420 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 down_read+0x36/0x80 kernel/locking/rwsem.c:24 nilfs_count_free_blocks+0x68/0x180 fs/nilfs2/the_nilfs.c:698 nilfs_set_log_cursor fs/nilfs2/super.c:237 [inline] nilfs_cleanup_super+0x133/0x490 fs/nilfs2/super.c:319 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) nilfs_put_super+0x152/0x1a0 fs/nilfs2/super.c:473 generic_shutdown_super+0x144/0x370 fs/super.c:456 kill_block_super+0x97/0xf0 fs/super.c:1185 deactivate_locked_super+0x94/0x160 fs/super.c:329 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 deactivate_super+0x174/0x1a0 fs/super.c:360 cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098 task_work_run+0x148/0x1c0 kernel/task_work.c:113 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f6a4fdb0a17 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 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:00007ffd8d5115d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f6a4fdb0a17 RDX: 00007ffd8d5116aa RSI: 000000000000000a RDI: 00007ffd8d5116a0 RBP: 00007ffd8d5116a0 R08: 00000000ffffffff R09: 00007ffd8d511470 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) R10: 0000555556678903 R11: 0000000000000246 R12: 00007f6a4fe09826 R13: 00007ffd8d512760 R14: 0000555556678810 R15: 00007ffd8d5127a0 sysfs: cannot create duplicate filename '/class/ieee80211/©,í…×;qO!' NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 CPU: 1 PID: 13780 Comm: syz-executor.0 Not tainted 4.19.211-syzkaller #0 IPVS: ftp: loaded support on port[0] = 21 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 sysfs_warn_dup.cold+0x1c/0x29 fs/sysfs/dir.c:30 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) sysfs_do_create_link_sd+0x116/0x130 fs/sysfs/symlink.c:50 sysfs_do_create_link fs/sysfs/symlink.c:79 [inline] sysfs_create_link+0x5f/0xc0 fs/sysfs/symlink.c:91 device_add_class_symlinks drivers/base/core.c:1934 [inline] device_add+0x7d1/0x16d0 drivers/base/core.c:2136 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 wiphy_register+0x1664/0x2130 net/wireless/core.c:832 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) ieee80211_register_hw+0x13be/0x3550 net/mac80211/main.c:1106 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) mac80211_hwsim_new_radio+0x1d3f/0x3c60 drivers/net/wireless/mac80211_hwsim.c:2896 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 hwsim_new_radio_nl+0x5c3/0x850 drivers/net/wireless/mac80211_hwsim.c:3374 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602 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) genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463 NILFS (loop5): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 genl_rcv+0x24/0x40 net/netlink/genetlink.c:638 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline] netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351 NILFS error (device loop5): nilfs_bmap_lookup_contig: broken bmap (inode number=16) netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917 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) sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227 __sys_sendmsg net/socket.c:2265 [inline] __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8d7f7105a9 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:00007f8d7dc83168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f8d7f830f80 RCX: 00007f8d7f7105a9 RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000006 RBP: 00007f8d7f76b7b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcaafcfb7f R14: 00007f8d7dc83300 R15: 0000000000022000 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) netlink: 'syz-executor.4': attribute type 4 has an invalid length. 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 (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 (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) audit: type=1800 audit(1667211915.308:17): pid=13738 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.5" name="file2" dev="loop5" ino=16 res=0 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) sysfs: cannot create duplicate filename '/class/ieee80211/©,í…×;qO!' CPU: 1 PID: 13839 Comm: syz-executor.0 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 sysfs_warn_dup.cold+0x1c/0x29 fs/sysfs/dir.c:30 sysfs_do_create_link_sd+0x116/0x130 fs/sysfs/symlink.c:50 sysfs_do_create_link fs/sysfs/symlink.c:79 [inline] sysfs_create_link+0x5f/0xc0 fs/sysfs/symlink.c:91 device_add_class_symlinks drivers/base/core.c:1934 [inline] device_add+0x7d1/0x16d0 drivers/base/core.c:2136 wiphy_register+0x1664/0x2130 net/wireless/core.c:832 ieee80211_register_hw+0x13be/0x3550 net/mac80211/main.c:1106 mac80211_hwsim_new_radio+0x1d3f/0x3c60 drivers/net/wireless/mac80211_hwsim.c:2896 hwsim_new_radio_nl+0x5c3/0x850 drivers/net/wireless/mac80211_hwsim.c:3374 genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602 genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463 genl_rcv+0x24/0x40 net/netlink/genetlink.c:638 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline] netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227 __sys_sendmsg net/socket.c:2265 [inline] __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8d7f7105a9 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:00007f8d7dc62168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f8d7f831050 RCX: 00007f8d7f7105a9 RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000005 RBP: 00007f8d7f76b7b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcaafcfb7f R14: 00007f8d7dc62300 R15: 0000000000022000 FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) netlink: 'syz-executor.4': attribute type 4 has an invalid length. netlink: 'syz-executor.1': attribute type 4 has an invalid length. FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) FAT-fs (loop3): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1) netlink: 'syz-executor.4': attribute type 4 has an invalid length. netlink: 'syz-executor.4': attribute type 4 has an invalid length. netlink: 'syz-executor.0': attribute type 4 has an invalid length. IPVS: ftp: loaded support on port[0] = 21 netlink: 'syz-executor.1': attribute type 4 has an invalid length. netlink: 'syz-executor.4': attribute type 4 has an invalid length. IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 netlink: 'syz-executor.4': attribute type 4 has an invalid length. ---------------- Code disassembly (best guess), 2 bytes skipped: 0: ff f7 push %rdi 2: d8 64 89 01 fsubs 0x1(%rcx,%rcx,4) 6: 48 83 c8 ff or $0xffffffffffffffff,%rax a: c3 retq b: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 11: 31 f6 xor %esi,%esi 13: e9 09 00 00 00 jmpq 0x21 18: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 1f: 00 00 21: b8 a6 00 00 00 mov $0xa6,%eax 26: 0f 05 syscall * 28: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 2e: 73 01 jae 0x31 30: c3 retq 31: 48 c7 c1 b8 ff ff ff mov $0xffffffffffffffb8,%rcx 38: f7 d8 neg %eax 3a: 64 89 01 mov %eax,%fs:(%rcx) 3d: 48 rex.W