================================================================== BUG: KASAN: slab-out-of-bounds in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff8881311edd1b by task syz-executor/371 CPU: 1 PID: 371 Comm: syz-executor Not tainted 6.1.118-syzkaller-00015-g770852bf7d99 #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:0x7f12a2fb8693 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:00007ffdb9ee9358 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555580bf84e0 RCX: 00007f12a2fb8693 RDX: 0000000000008000 RSI: 0000555580bf84e0 RDI: 0000000000000005 RBP: 0000555580bf84b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007f12a314bca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555580bf84b0 R15: 0000000000000001 Allocated by task 376: 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] kmalloc_trace+0x44/0xa0 mm/slab_common.c:1033 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:693 [inline] kobject_uevent_env+0x262/0x720 lib/kobject_uevent.c:539 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:657 netdev_queue_add_kobject net/core/net-sysfs.c:1671 [inline] netdev_queue_update_kobjects+0x235/0x4a0 net/core/net-sysfs.c:1712 register_queue_kobjects net/core/net-sysfs.c:1773 [inline] netdev_register_kobject+0x270/0x320 net/core/net-sysfs.c:2013 register_netdevice+0xe43/0x1490 net/core/dev.c:10123 veth_newlink+0x5db/0xc70 drivers/net/veth.c:1744 rtnl_newlink_create net/core/rtnetlink.c:3419 [inline] __rtnl_newlink net/core/rtnetlink.c:3639 [inline] rtnl_newlink+0x14c6/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 376: 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 kobject_uevent_env+0x511/0x720 lib/kobject_uevent.c:641 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:657 netdev_queue_add_kobject net/core/net-sysfs.c:1671 [inline] netdev_queue_update_kobjects+0x235/0x4a0 net/core/net-sysfs.c:1712 register_queue_kobjects net/core/net-sysfs.c:1773 [inline] netdev_register_kobject+0x270/0x320 net/core/net-sysfs.c:2013 register_netdevice+0xe43/0x1490 net/core/dev.c:10123 veth_newlink+0x5db/0xc70 drivers/net/veth.c:1744 rtnl_newlink_create net/core/rtnetlink.c:3419 [inline] __rtnl_newlink net/core/rtnetlink.c:3639 [inline] rtnl_newlink+0x14c6/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 ffff8881311ec000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3355 bytes to the right of 4096-byte region [ffff8881311ec000, ffff8881311ed000) The buggy address belongs to the physical page: page:ffffea0004c47a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1311e8 head:ffffea0004c47a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 dead000000000122 ffff888100043380 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 376, tgid 376 (syz-executor), ts 27261721833, free_ts 27088036227 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] kzalloc include/linux/slab.h:693 [inline] kobject_uevent_env+0x262/0x720 lib/kobject_uevent.c:539 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:657 netdev_queue_add_kobject net/core/net-sysfs.c:1671 [inline] netdev_queue_update_kobjects+0x235/0x4a0 net/core/net-sysfs.c:1712 register_queue_kobjects net/core/net-sysfs.c:1773 [inline] netdev_register_kobject+0x270/0x320 net/core/net-sysfs.c:2013 register_netdevice+0xe43/0x1490 net/core/dev.c:10123 veth_newlink+0x5db/0xc70 drivers/net/veth.c:1744 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: ffff8881311edc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881311edc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881311edd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881311edd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881311ede00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs error (device loop1): __ext4_get_inode_loc:4508: comm syz-executor: Invalid inode table block 14875662660405297151 in block_group 0 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5887: Corrupt filesystem EXT4-fs error (device loop1): ext4_dirty_inode:6091: inode #2: comm syz-executor: mark_inode_dirty error EXT4-fs (loop1): unmounting filesystem.