================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88812d9e1d1b by task syz-executor/371 CPU: 1 PID: 371 Comm: syz-executor Not tainted 5.15.176-syzkaller-00066-gd1a25a6a4b3b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:606 [inline] ext4_readdir+0x2f75/0x3960 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:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fc6740fa753 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 52 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:00007ffd59c95b18 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555567f7c4e0 RCX: 00007fc6740fa753 RDX: 0000000000008000 RSI: 0000555567f7c4e0 RDI: 0000000000000005 RBP: 0000555567f7c4b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007fc6742b7ca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555567f7c4b0 R15: 00007ffd59c97dd0 Allocated by task 370: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0xf5/0x250 mm/slub.c:3255 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_fib+0x13f/0x620 net/ipv4/fib_semantics.c:520 fib_table_insert+0xe1f/0x20c0 net/ipv4/fib_trie.c:1398 fib_magic net/ipv4/fib_frontend.c:1093 [inline] fib_add_ifaddr+0xb7d/0x15e0 net/ipv4/fib_frontend.c:1130 fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1429 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318 __inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:569 inet_rtm_newaddr+0x8fd/0x16e0 net/ipv4/devinet.c:968 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5647 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2493 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5665 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x564/0x720 net/socket.c:2063 __do_sys_sendto net/socket.c:2075 [inline] __se_sys_sendto net/socket.c:2071 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2071 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 370: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3521 [inline] kmem_cache_free+0x115/0x330 mm/slub.c:3539 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:758 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:930 netlink_broadcast_filtered+0x10f4/0x1220 net/netlink/af_netlink.c:1525 netlink_broadcast net/netlink/af_netlink.c:1547 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2536 rtnl_notify+0x9c/0xd0 net/core/rtnetlink.c:759 rtmsg_fib+0x3a1/0x620 net/ipv4/fib_semantics.c:540 fib_table_insert+0xe1f/0x20c0 net/ipv4/fib_trie.c:1398 fib_magic net/ipv4/fib_frontend.c:1093 [inline] fib_add_ifaddr+0xb7d/0x15e0 net/ipv4/fib_frontend.c:1130 fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1429 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318 __inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:569 inet_rtm_newaddr+0x8fd/0x16e0 net/ipv4/devinet.c:968 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5647 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2493 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5665 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x564/0x720 net/socket.c:2063 __do_sys_sendto net/socket.c:2075 [inline] __se_sys_sendto net/socket.c:2071 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2071 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88812d9e1c80 which belongs to the cache skbuff_head_cache of size 248 The buggy address is located 155 bytes inside of 248-byte region [ffff88812d9e1c80, ffff88812d9e1d78) The buggy address belongs to the page: page:ffffea0004b67840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12d9e1 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881081aad80 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 370, ts 27971170364, free_ts 26088083098 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0x139/0x250 mm/slub.c:3255 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_fib+0x13f/0x620 net/ipv4/fib_semantics.c:520 fib_table_insert+0xe1f/0x20c0 net/ipv4/fib_trie.c:1398 fib_magic net/ipv4/fib_frontend.c:1093 [inline] fib_add_ifaddr+0x43f/0x15e0 net/ipv4/fib_frontend.c:1115 fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1429 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318 __inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:569 inet_rtm_newaddr+0x8fd/0x16e0 net/ipv4/devinet.c:968 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5856 __vunmap+0x7c1/0x940 mm/vmalloc.c:2652 __vfree mm/vmalloc.c:2701 [inline] vfree+0x7f/0xb0 mm/vmalloc.c:2732 kcov_put kernel/kcov.c:417 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:519 __fput+0x228/0x8c0 fs/file_table.c:280 ____fput+0x15/0x20 fs/file_table.c:308 task_work_run+0x129/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc48/0x2ca0 kernel/exit.c:880 do_group_exit+0x141/0x310 kernel/exit.c:1002 get_signal+0x7a3/0x1630 kernel/signal.c:2907 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:307 Memory state around the buggy address: ffff88812d9e1c00: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ffff88812d9e1c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88812d9e1d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ^ ffff88812d9e1d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88812d9e1e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop4): __ext4_get_inode_loc:4351: comm syz-executor: Invalid inode table block 14875662660405297151 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5837: Corrupt filesystem EXT4-fs error (device loop4): ext4_dirty_inode:6041: inode #2: comm syz-executor: mark_inode_dirty error