================================================================== BUG: KASAN: slab-out-of-bounds in ext4_htree_store_dirent+0x198/0x5c0 fs/ext4/dir.c:494 Read of size 255 at addr ffff88812bd24367 by task syz-executor/1555 CPU: 1 PID: 1555 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 mm/kasan/report.c:444 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 memcpy+0x2d/0x70 mm/kasan/shadow.c:65 ext4_htree_store_dirent+0x198/0x5c0 fs/ext4/dir.c:494 ext4_htree_fill_tree+0x6cd/0x10d0 fs/ext4/namei.c:1247 ext4_dx_readdir fs/ext4/dir.c:609 [inline] ext4_readdir+0x2bfd/0x3a40 fs/ext4/dir.c:145 iterate_dir+0x260/0x600 fs/readdir.c:-1 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0xe5/0x240 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x592/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fe03f166ad3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 72 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:00007ffd27604768 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055555bde64e0 RCX: 00007fe03f166ad3 RDX: 0000000000008000 RSI: 000055555bde64e0 RDI: 0000000000000005 RBP: 000055555bde64b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007fe03f323ca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 000055555bde64b0 R15: 00007ffd27606a20 Allocated by task 1469: 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+0xbd/0xf0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x4f/0x2b0 mm/slab.h:550 slab_alloc_node mm/slub.c:3245 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0xf7/0x260 mm/slub.c:3260 kmem_cache_zalloc include/linux/slab.h:740 [inline] __kernfs_new_node+0xdb/0x680 fs/kernfs/dir.c:593 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:669 __kernfs_create_file+0x4e/0x270 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x29a/0x350 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x489/0xcf0 fs/sysfs/group.c:149 internal_create_groups fs/sysfs/group.c:189 [inline] sysfs_create_groups+0x58/0x120 fs/sysfs/group.c:215 device_add_groups drivers/base/core.c:2501 [inline] device_add_attrs+0x8c/0x700 drivers/base/core.c:2649 device_add+0x5e3/0xed0 drivers/base/core.c:3373 netdev_register_kobject+0x179/0x320 net/core/net-sysfs.c:2014 register_netdevice+0xdfa/0x13a0 net/core/dev.c:10405 veth_newlink+0x668/0xda0 drivers/net/veth.c:1683 __rtnl_newlink net/core/rtnetlink.c:3524 [inline] rtnl_newlink+0x112d/0x17b0 net/core/rtnetlink.c:3572 rtnetlink_rcv_msg+0x9e4/0xb90 net/core/rtnetlink.c:5650 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2511 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5668 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x876/0xa40 net/netlink/af_netlink.c:1348 netlink_sendmsg+0x86a/0xb70 net/netlink/af_netlink.c:1922 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x423/0x580 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+0x178/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88812bd24320 which belongs to the cache kernfs_node_cache of size 136 The buggy address is located 71 bytes inside of 136-byte region [ffff88812bd24320, ffff88812bd243a8) The buggy address belongs to the page: page:ffffea0004af4900 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12bd24 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881001c4000 raw: 0000000000000000 0000000000140014 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 1469, ts 117832782793, free_ts 117773711108 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5808 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa1/0x4d0 mm/slub.c:2000 ___slab_alloc+0x381/0x810 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0x138/0x260 mm/slub.c:3260 kmem_cache_zalloc include/linux/slab.h:740 [inline] __kernfs_new_node+0xdb/0x680 fs/kernfs/dir.c:593 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:669 __kernfs_create_file+0x4e/0x270 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x29a/0x350 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x489/0xcf0 fs/sysfs/group.c:149 internal_create_groups fs/sysfs/group.c:189 [inline] sysfs_create_groups+0x58/0x120 fs/sysfs/group.c:215 device_add_groups drivers/base/core.c:2501 [inline] device_add_attrs+0x8c/0x700 drivers/base/core.c:2649 device_add+0x5e3/0xed0 drivers/base/core.c:3373 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+0x542/0x550 mm/page_alloc.c:3534 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0xfda/0x1030 mm/swap.c:1014 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x175/0x300 mm/mmu_gather.c:338 exit_mmap+0x40f/0x860 mm/mmap.c:3248 __mmput+0x93/0x320 kernel/fork.c:1180 mmput+0x50/0x150 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0x9d2/0x27a0 kernel/exit.c:876 do_group_exit+0x141/0x310 kernel/exit.c:1003 __do_sys_exit_group kernel/exit.c:1014 [inline] __se_sys_exit_group kernel/exit.c:1012 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1012 x64_sys_call+0x832/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88812bd24280: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88812bd24300: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812bd24380: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ^ ffff88812bd24400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ffff88812bd24480: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 ================================================================== EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0