loop0: detected capacity change from 0 to 4096 ================================================================== BUG: KASAN: use-after-free in nilfs_find_entry+0x29c/0x660 fs/nilfs2/dir.c:321 Read of size 2 at addr ffff888056e008dd by task syz.0.20/5819 CPU: 0 UID: 0 PID: 5819 Comm: syz.0.20 Not tainted 6.13.0-rc1-syzkaller-00002-gcdd30ebb1b9f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 nilfs_find_entry+0x29c/0x660 fs/nilfs2/dir.c:321 nilfs_inode_by_name+0xad/0x240 fs/nilfs2/dir.c:394 nilfs_lookup+0xed/0x210 fs/nilfs2/namei.c:63 lookup_open fs/namei.c:3627 [inline] open_last_lookups fs/namei.c:3748 [inline] path_openat+0x11a7/0x3590 fs/namei.c:3984 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f890557e719 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f89063a2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f8905735f80 RCX: 00007f890557e719 RDX: 000000000000275a RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007f89055f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8905735f80 R15: 00007ffc3060f048 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7f9ef4201 pfn:0x56e00 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 04fff00000000000 ffffea0001258008 ffffea00015ba008 0000000000000000 raw: 00000007f9ef4201 0000000000000006 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0xcc0(GFP_KERNEL), pid 5370, tgid 5370 (syz-executor), ts 68666646722, free_ts 97471143060 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 get_free_pages_noprof+0xc/0x30 mm/page_alloc.c:4798 kasan_populate_vmalloc_pte+0x38/0xe0 mm/kasan/shadow.c:304 apply_to_pte_range mm/memory.c:2831 [inline] apply_to_pmd_range mm/memory.c:2875 [inline] apply_to_pud_range mm/memory.c:2911 [inline] apply_to_p4d_range mm/memory.c:2947 [inline] __apply_to_page_range+0x806/0xde0 mm/memory.c:2981 alloc_vmap_area+0x1d4e/0x2400 mm/vmalloc.c:2035 __get_vm_area_node+0x1c8/0x2d0 mm/vmalloc.c:3137 __vmalloc_node_range_noprof+0x344/0x1380 mm/vmalloc.c:3804 vmalloc_user_noprof+0x74/0x80 mm/vmalloc.c:3998 kcov_ioctl+0x56/0x640 kernel/kcov.c:716 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xdef/0x1130 mm/page_alloc.c:2657 kasan_depopulate_vmalloc_pte+0x74/0x90 mm/kasan/shadow.c:408 apply_to_pte_range mm/memory.c:2831 [inline] apply_to_pmd_range mm/memory.c:2875 [inline] apply_to_pud_range mm/memory.c:2911 [inline] apply_to_p4d_range mm/memory.c:2947 [inline] __apply_to_page_range+0x806/0xde0 mm/memory.c:2981 kasan_release_vmalloc+0xa5/0xd0 mm/kasan/shadow.c:529 kasan_release_vmalloc_node mm/vmalloc.c:2196 [inline] purge_vmap_node+0x22f/0x8d0 mm/vmalloc.c:2213 __purge_vmap_area_lazy+0x708/0xae0 mm/vmalloc.c:2304 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2338 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888056e00780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888056e00800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888056e00880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888056e00900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888056e00980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================