loop0: detected capacity change from 512 to 511 ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 Read of size 1 at addr ffff8881275af3aa by task syz.0.1628/4900 CPU: 1 PID: 4900 Comm: syz.0.1628 Not tainted 6.1.112-syzkaller-00006-g96ad4e759ff4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:348 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1726 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1617 ext4_lookup_entry fs/ext4/namei.c:1772 [inline] ext4_lookup+0x176/0x740 fs/ext4/namei.c:1840 __lookup_slow+0x2b9/0x3e0 fs/namei.c:1689 lookup_slow+0x5a/0x80 fs/namei.c:1706 walk_component+0x2e7/0x410 fs/namei.c:1997 lookup_last fs/namei.c:2454 [inline] path_lookupat+0x16d/0x450 fs/namei.c:2478 filename_lookup+0x251/0x600 fs/namei.c:2507 do_linkat+0x177/0x9f0 fs/namei.c:4651 __do_sys_link fs/namei.c:4705 [inline] __se_sys_link fs/namei.c:4703 [inline] __x64_sys_link+0x86/0x90 fs/namei.c:4703 x64_sys_call+0x282/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:87 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f805a57e719 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:00007f805b37a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f805a735f80 RCX: 00007f805a57e719 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000020000000 RBP: 00007f805a5f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f805a735f80 R15: 00007ffd34aa5d28 The buggy address belongs to the physical page: page:ffffea00049d6bc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1275af flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100ba5800 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 4891, tgid 4891 (syz-executor), ts 193877602448, free_ts 162157988884 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x2980/0x2a10 mm/page_alloc.c:4439 __alloc_pages+0x234/0x610 mm/page_alloc.c:5728 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] kmem_cache_alloc_node+0x1c9/0x2d0 mm/slub.c:3466 __alloc_skb+0xcc/0x2d0 net/core/skbuff.c:505 alloc_skb include/linux/skbuff.h:1290 [inline] nlmsg_new include/net/netlink.h:991 [inline] rtmsg_fib+0x140/0x620 net/ipv4/fib_semantics.c:522 fib_table_insert+0x116c/0x20a0 net/ipv4/fib_trie.c:1404 fib_magic net/ipv4/fib_frontend.c:1104 [inline] fib_add_ifaddr+0xe49/0x15e0 net/ipv4/fib_frontend.c:1148 fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1440 notifier_call_chain kernel/notifier.c:87 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:382 __inet_insert_ifa+0x8fb/0xb10 net/ipv4/devinet.c:554 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3511 free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3607 free_the_page mm/page_alloc.c:798 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5817 __vunmap+0x9f3/0xb60 mm/vmalloc.c:2728 __vfree mm/vmalloc.c:2776 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2807 kcov_put kernel/kcov.c:437 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:533 __fput+0x1e5/0x870 fs/file_table.c:320 ____fput+0x15/0x20 fs/file_table.c:348 task_work_run+0x24d/0x2e0 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xbd5/0x2b80 kernel/exit.c:877 do_group_exit+0x21a/0x2d0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 x64_sys_call+0x610/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff8881275af280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881275af300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881275af380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff8881275af400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881275af480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== EXT4-fs (loop0): unmounting filesystem.