================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88812fa44a67 by task syz-executor/362 CPU: 1 PID: 362 Comm: syz-executor Not tainted 6.1.118-syzkaller-00074-g3e3f2b9e9fca #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_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:605 [inline] ext4_readdir+0x2e6f/0x3860 fs/ext4/dir.c:142 iterate_dir+0x265/0x600 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x5ae/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 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:0x7fbf4f5b8693 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 82 3e f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffd560ab368 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00005555563f14e0 RCX: 00007fbf4f5b8693 RDX: 0000000000008000 RSI: 00005555563f14e0 RDI: 0000000000000005 RBP: 00005555563f14b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007fbf4f74bca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 00005555563f14b0 R15: 0000000000000001 Allocated by task 362: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] kmem_cache_alloc_node+0x188/0x330 mm/slub.c:3468 __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+0xb7d/0x15e0 net/ipv4/fib_frontend.c:1141 fib_netdev_event+0x23f/0x5a0 net/ipv4/fib_frontend.c:1486 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:455 __dev_notify_flags+0x304/0x610 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8685 do_setlink+0xdb8/0x4050 net/core/rtnetlink.c:2830 __rtnl_newlink net/core/rtnetlink.c:3605 [inline] rtnl_newlink+0x170f/0x2030 net/core/rtnetlink.c:3652 rtnetlink_rcv_msg+0x9a5/0xca0 net/core/rtnetlink.c:6150 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2518 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6168 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 netlink_sendmsg+0xa15/0xd30 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] __sys_sendto+0x480/0x600 net/socket.c:2143 __do_sys_sendto net/socket.c:2155 [inline] __se_sys_sendto net/socket.c:2151 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2151 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 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 Freed by task 362: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3686 [inline] kmem_cache_free+0x291/0x560 mm/slub.c:3711 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:871 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:1035 netlink_broadcast+0x103c/0x1160 net/netlink/af_netlink.c:1524 nlmsg_multicast include/net/netlink.h:1071 [inline] nlmsg_notify+0xfb/0x1c0 net/netlink/af_netlink.c:2561 rtnl_notify+0x9c/0xd0 net/core/rtnetlink.c:796 rtmsg_fib+0x39f/0x620 net/ipv4/fib_semantics.c:542 fib_table_insert+0x116c/0x20a0 net/ipv4/fib_trie.c:1404 fib_magic net/ipv4/fib_frontend.c:1104 [inline] fib_add_ifaddr+0xb7d/0x15e0 net/ipv4/fib_frontend.c:1141 fib_netdev_event+0x23f/0x5a0 net/ipv4/fib_frontend.c:1486 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:455 __dev_notify_flags+0x304/0x610 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8685 do_setlink+0xdb8/0x4050 net/core/rtnetlink.c:2830 __rtnl_newlink net/core/rtnetlink.c:3605 [inline] rtnl_newlink+0x170f/0x2030 net/core/rtnetlink.c:3652 rtnetlink_rcv_msg+0x9a5/0xca0 net/core/rtnetlink.c:6150 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2518 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6168 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 netlink_sendmsg+0xa15/0xd30 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] __sys_sendto+0x480/0x600 net/socket.c:2143 __do_sys_sendto net/socket.c:2155 [inline] __se_sys_sendto net/socket.c:2151 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2151 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 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 The buggy address belongs to the object at ffff88812fa44a00 which belongs to the cache skbuff_head_cache of size 256 The buggy address is located 103 bytes inside of 256-byte region [ffff88812fa44a00, ffff88812fa44b00) The buggy address belongs to the physical page: page:ffffea0004be9100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12fa44 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100b9be00 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 362, tgid 362 (syz-executor), ts 25611811851, free_ts 25048266739 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+0x2f41/0x2fc0 mm/page_alloc.c:4462 __alloc_pages+0x234/0x610 mm/page_alloc.c:5759 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+0x1d0/0x330 mm/slub.c:3468 __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+0xb7d/0x15e0 net/ipv4/fib_frontend.c:1141 fib_netdev_event+0x23f/0x5a0 net/ipv4/fib_frontend.c:1486 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:455 __dev_notify_flags+0x304/0x610 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:5848 __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 get_signal+0x169d/0x1820 kernel/signal.c:2889 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:174 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:303 Memory state around the buggy address: ffff88812fa44900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812fa44980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88812fa44a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812fa44a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812fa44b00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== EXT4-fs (loop2): unmounting filesystem.