BUG: KASAN: slab-out-of-bounds in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88810d7f7a67 by task syz-executor225/307 CPU: 0 PID: 307 Comm: syz-executor225 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:0x7f4f17789023 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 99 fa 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 b0 ff ff ff f7 d8 RSP: 002b:00007ffdc1151208 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555559c74830 RCX: 00007f4f17789023 RDX: 0000000000008000 RSI: 0000555559c74830 RDI: 0000000000000004 RBP: 0000555559c74804 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb0 R13: 0000000000000010 R14: 0000555559c74800 R15: 0000000000000001 Allocated by task 329: 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_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc_node+0xb4/0x1e0 mm/slab_common.c:945 kmalloc_node include/linux/slab.h:583 [inline] kvmalloc_node+0x221/0x640 mm/util.c:592 kvmalloc include/linux/slab.h:710 [inline] simple_xattr_alloc fs/xattr.c:1008 [inline] simple_xattr_set+0xba/0x580 fs/xattr.c:1072 shmem_xattr_handler_set+0x46/0xe0 mm/shmem.c:3342 __vfs_setxattr+0x3ed/0x440 fs/xattr.c:182 __vfs_setxattr_noperm+0x126/0x5e0 fs/xattr.c:216 __vfs_setxattr_locked+0x215/0x230 fs/xattr.c:277 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:655 x64_sys_call+0x506/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:190 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 329: 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+0x21d/0x410 mm/slub.c:3702 kfree+0x7a/0xf0 mm/slab_common.c:990 kvfree+0x35/0x40 mm/util.c:639 simple_xattr_set+0x55c/0x580 fs/xattr.c:1112 shmem_xattr_handler_set+0x46/0xe0 mm/shmem.c:3342 __vfs_setxattr+0x3ed/0x440 fs/xattr.c:182 __vfs_setxattr_noperm+0x126/0x5e0 fs/xattr.c:216 __vfs_setxattr_locked+0x215/0x230 fs/xattr.c:277 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:655 x64_sys_call+0x506/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:190 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 ffff88810d7f7a00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 39 bytes to the right of 64-byte region [ffff88810d7f7a00, ffff88810d7f7a40) The buggy address belongs to the physical page: page:ffffea000435fdc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d7f7 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100042780 raw: 0000000000000000 0000000000200020 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 294, tgid 294 (strace-static-x), ts 28768546849, free_ts 28768267626 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+0x207/0x2a0 mm/slub.c:3462 kmalloc_trace+0x2a/0xa0 mm/slab_common.c:1028 kmalloc include/linux/slab.h:557 [inline] call_modprobe kernel/kmod.c:79 [inline] __request_module+0x28c/0x8d0 kernel/kmod.c:170 sock_load_diag_module+0xd6/0x130 net/core/sock.c:3989 __sock_diag_cmd net/core/sock_diag.c:228 [inline] sock_diag_rcv_msg+0x205/0x400 net/core/sock_diag.c:266 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2518 sock_diag_rcv+0x28/0x40 net/core/sock_diag.c:277 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 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+0x13/0x20 mm/page_alloc.c:798 page_frag_free+0x108/0x120 mm/page_alloc.c:5987 skb_free_frag include/linux/skbuff.h:3260 [inline] skb_free_head net/core/skbuff.c:760 [inline] skb_release_data+0x6ba/0x840 net/core/skbuff.c:791 skb_release_all net/core/skbuff.c:856 [inline] __kfree_skb+0x50/0x70 net/core/skbuff.c:870 tcp_rcv_established+0xe39/0x1c60 net/ipv4/tcp_input.c:6007 tcp_v4_do_rcv+0x430/0xa20 net/ipv4/tcp_ipv4.c:1683 tcp_v4_rcv+0x20d7/0x2a30 net/ipv4/tcp_ipv4.c:2114 ip_protocol_deliver_rcu+0x32f/0x720 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x246/0x400 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:305 [inline] ip_local_deliver+0x1b3/0x3b0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0x7e5/0x990 net/ipv4/ip_input.c:639 ip_list_rcv+0x422/0x470 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5595 [inline] __netif_receive_skb_list_core+0x6b1/0x890 net/core/dev.c:5643 __netif_receive_skb_list net/core/dev.c:5695 [inline] netif_receive_skb_list_internal+0x967/0xcc0 net/core/dev.c:5786 Memory state around the buggy address: ffff88810d7f7900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810d7f7980: 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc fc >ffff88810d7f7a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810d7f7a80: 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc fc ffff88810d7f7b00: 00 00 00 00 00 00 00 03 fc fc fc fc fc fc fc fc ================================================================== EXT4-fs (loop3): unmounting filesystem.