NILFS error (device loop3): nilfs_bmap_lookup_contig: broken bmap (inode number=16) ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/15203 is trying to acquire lock: 000000003599aebe (&nilfs->ns_sem){++++}, at: nilfs_set_error fs/nilfs2/super.c:86 [inline] 000000003599aebe (&nilfs->ns_sem){++++}, at: __nilfs_error+0x195/0x401 fs/nilfs2/super.c:131 but task is already holding lock: 0000000082b3e16b (&dat_lock_key){.+.+}, at: nilfs_get_block+0x18f/0x970 fs/nilfs2/inode.c:79 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&dat_lock_key){.+.+}: 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 -> #0 (&nilfs->ns_sem){++++}: down_write+0x34/0x90 kernel/locking/rwsem.c:70 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 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 *** 2 locks held by syz-executor.3/15203: #0: 00000000fdc1b932 (&iint->mutex){+.+.}, at: process_measurement+0x316/0x1440 security/integrity/ima/ima_main.c:224 #1: 0000000082b3e16b (&dat_lock_key){.+.+}, at: nilfs_get_block+0x18f/0x970 fs/nilfs2/inode.c:79 stack backtrace: CPU: 1 PID: 15203 Comm: syz-executor.3 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 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 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 down_write+0x34/0x90 kernel/locking/rwsem.c:70 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 RIP: 0033:0x7f65fe1c85a9 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:00007f65fc73b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f65fe2e8f80 RCX: 00007f65fe1c85a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000880 RBP: 00007f65fe2237b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe97cd8faf R14: 00007f65fc73b300 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) wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 NILFS (loop3): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 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) kauditd_printk_skb: 2 callbacks suppressed audit: type=1800 audit(1667159908.662:133): pid=15203 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.3" name="file2" dev="loop3" ino=16 res=0 audit: type=1800 audit(1667159908.662:134): pid=15215 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.3" name="file2" dev="loop3" ino=16 res=0 NILFS (loop3): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds netlink: 188 bytes leftover after parsing attributes in process `syz-executor.1'. wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 netlink: 188 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 'syz-executor.4': attribute type 17 has an invalid length. netlink: 188 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs (loop3): Unrecognized mount option "[E.wGТ^0mcU\.!*`;H_4\%wNVft[;)K>"xѬwJzȂqhe;%UF^E^tYgNdCĺ(F{Vs6b‘(#@Ak_̥M8hjߔ^*myq{ }" or missing value IPVS: ftp: loaded support on port[0] = 21 device bond1 entered promiscuous mode netlink: 23 bytes leftover after parsing attributes in process `syz-executor.4'. device veth9 entered promiscuous mode bond1: Enslaving veth9 as an active interface with an up link netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. base_sock_release(00000000ea2a15ee) sk=000000002b65b25c netlink: 'syz-executor.4': attribute type 17 has an invalid length. device bond2 entered promiscuous mode netlink: 23 bytes leftover after parsing attributes in process `syz-executor.4'. EXT4-fs (loop3): Unrecognized mount option "[E.wGТ^0mcU\.!*`;H_4\%wNVft[;)K>"xѬwJzȂqhe;%UF^E^tYgNdCĺ(F{Vs6b‘(#@Ak_̥M8hjߔ^*myq{ }" or missing value device veth11 entered promiscuous mode bond2: Enslaving veth11 as an active interface with an up link bond2 (unregistering): Releasing backup interface veth11 bond2 (unregistering): Released all slaves netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. base_sock_release(00000000a2c3e9d6) sk=0000000080b6d97c netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 'syz-executor.4': attribute type 17 has an invalid length. EXT4-fs warning (device loop5): read_mmp_block:110: Error -117 while reading MMP block 115 device bond2 entered promiscuous mode netlink: 23 bytes leftover after parsing attributes in process `syz-executor.4'. EXT4-fs warning (device loop3): read_mmp_block:110: Error -117 while reading MMP block 115 device veth13 entered promiscuous mode IPVS: ftp: loaded support on port[0] = 21 bond2: Enslaving veth13 as an active interface with an up link bond2 (unregistering): Releasing backup interface veth13 bond2 (unregistering): Released all slaves base_sock_release(000000007c55673d) sk=000000008a3e5c8b IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 EXT4-fs (loop5): Unrecognized mount option "[E.wGТ^0mcU\.!*`;H_4\%wNVft[;)K>"xѬwJzȂqhe;%UF^E^tYgNdCĺ(F{Vs6b‘(#@Ak_̥M8hjߔ^*myq{ }" or missing value IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 EXT4-fs (loop4): Unrecognized mount option "[E.wGТ^0mcU\.!*`;H_4\%wNVft[;)K>"xѬwJzȂqhe;%UF^E^tYgNdCĺ(F{Vs6b‘(#@Ak_̥M8hjߔ^*myq{ }" or missing value EXT4-fs (loop5): Unrecognized mount option "[E.wGТ^0mcU\.!*`;H_4\%wNVft[;)K>"xѬwJzȂqhe;%UF^E^tYgNdCĺ(F{Vs6b‘(#@Ak_̥M8hjߔ^*myq{ }" or missing value IPVS: ftp: loaded support on port[0] = 21