audit: type=1804 audit(1667806242.508:617): pid=31339 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.3" name="/root/syzkaller-testdir2894126658/syzkaller.oAMdKg/2080/file0/file0" dev="loop3" ino=153 res=1 IPVS: ftp: loaded support on port[0] = 21 NILFS (loop4): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. CPU: 1 PID: 31363 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 assign_lock_key kernel/locking/lockdep.c:728 [inline] register_lock_class+0xe82/0x11c0 kernel/locking/lockdep.c:754 __lock_acquire+0x17d/0x3ff0 kernel/locking/lockdep.c:3304 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 down_read+0x36/0x80 kernel/locking/rwsem.c:24 nilfs_bmap_lookup_at_level+0x7b/0x3e0 fs/nilfs2/bmap.c:68 nilfs_bmap_lookup fs/nilfs2/bmap.h:170 [inline] nilfs_mdt_submit_block.constprop.0+0x1a5/0xaa0 fs/nilfs2/mdt.c:142 nilfs_mdt_read_block+0x96/0x3e0 fs/nilfs2/mdt.c:175 nilfs_mdt_get_block+0xe6/0xd40 fs/nilfs2/mdt.c:250 nilfs_palloc_get_block+0xc4/0x2b0 fs/nilfs2/alloc.c:216 nilfs_palloc_get_entry_block+0x17b/0x230 fs/nilfs2/alloc.c:318 nilfs_ifile_get_inode_block+0xbf/0x170 fs/nilfs2/ifile.c:143 __nilfs_read_inode fs/nilfs2/inode.c:483 [inline] nilfs_iget+0x204/0x860 fs/nilfs2/inode.c:592 nilfs_get_root_dentry+0x26/0x250 fs/nilfs2/super.c:908 nilfs_fill_super fs/nilfs2/super.c:1082 [inline] nilfs_mount+0xac8/0xe70 fs/nilfs2/super.c:1321 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f761de2cada Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 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:00007f761c37cf88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f761de2cada RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f761c37cfe0 RBP: 00007f761c37d020 R08: 00007f761c37d020 R09: 0000000020000000 R10: 0000000000800000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f761c37cfe0 R15: 0000000020001380 ================================================================== BUG: KASAN: use-after-free in nilfs_bmap_lookup_at_level+0x348/0x3e0 fs/nilfs2/bmap.c:69 Read of size 8 at addr ffff88802baa7420 by task syz-executor.4/31363 CPU: 1 PID: 31363 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 nilfs_bmap_lookup_at_level+0x348/0x3e0 fs/nilfs2/bmap.c:69 nilfs_bmap_lookup fs/nilfs2/bmap.h:170 [inline] nilfs_mdt_submit_block.constprop.0+0x1a5/0xaa0 fs/nilfs2/mdt.c:142 nilfs_mdt_read_block+0x96/0x3e0 fs/nilfs2/mdt.c:175 nilfs_mdt_get_block+0xe6/0xd40 fs/nilfs2/mdt.c:250 nilfs_palloc_get_block+0xc4/0x2b0 fs/nilfs2/alloc.c:216 nilfs_palloc_get_entry_block+0x17b/0x230 fs/nilfs2/alloc.c:318 nilfs_ifile_get_inode_block+0xbf/0x170 fs/nilfs2/ifile.c:143 __nilfs_read_inode fs/nilfs2/inode.c:483 [inline] nilfs_iget+0x204/0x860 fs/nilfs2/inode.c:592 nilfs_get_root_dentry+0x26/0x250 fs/nilfs2/super.c:908 nilfs_fill_super fs/nilfs2/super.c:1082 [inline] nilfs_mount+0xac8/0xe70 fs/nilfs2/super.c:1321 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f761de2cada Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 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:00007f761c37cf88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f761de2cada RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f761c37cfe0 RBP: 00007f761c37d020 R08: 00007f761c37d020 R09: 0000000020000000 R10: 0000000000800000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f761c37cfe0 R15: 0000000020001380 Allocated by task 30527: kmem_cache_alloc+0x122/0x370 mm/slab.c:3559 __d_alloc+0x2b/0xa10 fs/dcache.c:1612 d_alloc+0x4a/0x230 fs/dcache.c:1696 __lookup_hash+0xc8/0x180 fs/namei.c:1543 filename_create+0x186/0x490 fs/namei.c:3639 user_path_create fs/namei.c:3696 [inline] do_symlinkat+0xe1/0x2c0 fs/namei.c:4149 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 4696: __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x7f/0x260 mm/slab.c:3765 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881 __do_softirq+0x265/0x980 kernel/softirq.c:292 The buggy address belongs to the object at ffff88802baa7420 which belongs to the cache dentry of size 288 The buggy address is located 0 bytes inside of 288-byte region [ffff88802baa7420, ffff88802baa7540) The buggy address belongs to the page: page:ffffea0000aea9c0 count:1 mapcount:0 mapping:ffff88813be45200 index:0xffff88802baa7000 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00023205c8 ffffea0000e7e1c8 ffff88813be45200 raw: ffff88802baa7000 ffff88802baa7000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802baa7300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802baa7380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88802baa7400: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802baa7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802baa7500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================