================================================================== BUG: KASAN: slab-out-of-bounds in ext4_htree_fill_tree+0x1324/0x13f0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88812bbefa67 by task syz-executor/473 CPU: 1 UID: 0 PID: 473 Comm: syz-executor Not tainted 6.13.0-rc5-syzkaller-00012-g0bc21e701a6f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x188/0x200 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x163/0x550 mm/kasan/report.c:489 kasan_report+0x14f/0x190 mm/kasan/report.c:602 __asan_report_load1_noabort+0x18/0x20 mm/kasan/report_generic.c:378 ext4_htree_fill_tree+0x1324/0x13f0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:598 [inline] ext4_readdir+0x3298/0x40f0 fs/ext4/dir.c:143 iterate_dir+0x1ed/0x5c0 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1d2/0x4a0 fs/readdir.c:389 __x64_sys_getdents64+0x7f/0x90 fs/readdir.c:389 x64_sys_call+0x2d52/0x2e00 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0xf0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f38fe9b8693 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:00007ffd90ffac08 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555592ff24e0 RCX: 00007f38fe9b8693 RDX: 0000000000008000 RSI: 0000555592ff24e0 RDI: 0000000000000005 RBP: 0000555592ff24b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007f38feb4bca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555592ff24b0 R15: 0000000000000001 </TASK> Allocated by task 452: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_alloc_info+0x3c/0x50 mm/kasan/generic.c:568 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9d/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x17c/0x300 mm/slub.c:4329 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] inetdev_init+0x83/0x4d0 net/ipv4/devinet.c:281 inetdev_event+0x40d/0x10d0 net/ipv4/devinet.c:1598 notifier_call_chain+0xf4/0x2d0 kernel/notifier.c:85 raw_notifier_call_chain+0x31/0x40 kernel/notifier.c:453 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers+0x149/0x1c0 net/core/dev.c:2048 register_netdevice+0x10f8/0x14a0 net/core/dev.c:10632 __ip_tunnel_create+0x2b4/0x380 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x287/0x790 net/ipv4/ip_tunnel.c:1160 erspan_init_net+0x2d/0x40 net/ipv4/ip_gre.c:1756 ops_init+0x1a5/0x440 net/core/net_namespace.c:138 setup_net+0x259/0xa40 net/core/net_namespace.c:362 copy_net_ns+0x503/0x820 net/core/net_namespace.c:516 create_new_namespaces+0x41a/0x680 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x12c/0x190 kernel/nsproxy.c:228 ksys_unshare+0x5e7/0x9d0 kernel/fork.c:3333 __do_sys_unshare kernel/fork.c:3404 [inline] __se_sys_unshare kernel/fork.c:3402 [inline] __x64_sys_unshare+0x3c/0x50 kernel/fork.c:3402 x64_sys_call+0x1a71/0x2e00 arch/x86/include/generated/asm/syscalls_64.h:273 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0xf0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 402: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x44/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x57/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x143/0x370 mm/slub.c:4761 in_dev_free_rcu+0x50/0x60 net/ipv4/devinet.c:254 rcu_do_batch+0x57a/0xd20 kernel/rcu/tree.c:2567 rcu_core+0x58b/0xd00 kernel/rcu/tree.c:2823 rcu_core_si+0xd/0x20 kernel/rcu/tree.c:2840 handle_softirqs+0x18f/0x580 kernel/softirq.c:561 __do_softirq+0xf/0x15 kernel/softirq.c:595 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:544 kasan_record_aux_stack_noalloc+0xf/0x20 mm/kasan/generic.c:554 __call_rcu_common kernel/rcu/tree.c:3086 [inline] call_rcu+0xe3/0x10d0 kernel/rcu/tree.c:3190 in_dev_finish_destroy+0x121/0x170 net/ipv4/devinet.c:270 in_dev_put include/linux/inetdevice.h:290 [inline] inetdev_destroy net/ipv4/devinet.c:346 [inline] inetdev_event+0x8b1/0x10d0 net/ipv4/devinet.c:1663 notifier_call_chain+0xf4/0x2d0 kernel/notifier.c:85 raw_notifier_call_chain+0x31/0x40 kernel/notifier.c:453 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] unregister_netdevice_many_notify+0x109e/0x2020 net/core/dev.c:11526 unregister_netdevice_many+0x1d/0x30 net/core/dev.c:11590 cleanup_net+0x695/0xd30 net/core/net_namespace.c:643 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0x766/0x1040 kernel/workqueue.c:3310 worker_thread+0x974/0xdc0 kernel/workqueue.c:3391 kthread+0x2e7/0x380 kernel/kthread.c:389 ret_from_fork+0x55/0x90 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88812bbef800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 103 bytes to the right of allocated 512-byte region [ffff88812bbef800, ffff88812bbefa00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12bbec head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4000000000000040(head|zone=1) page_type: f5(slab) raw: 4000000000000040 ffff888100041c80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 4000000000000040 ffff888100041c80 dead000000000122 0000000000000000 head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 4000000000000002 ffffea0004aefb01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 448, tgid 448 (syz-executor), ts 52708314215, free_ts 29935916728 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x234/0x260 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x482b/0x48c0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x3e8/0x890 mm/page_alloc.c:4753 allocate_slab+0xbb/0x4c0 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0x7e0/0xcf0 mm/slub.c:3830 __slab_alloc+0x5d/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __kmalloc_cache_noprof+0x1b9/0x300 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] find_css_set+0x9db/0x1580 kernel/cgroup/cgroup.c:1194 cgroup_migrate_prepare_dst+0xc9/0x910 kernel/cgroup/cgroup.c:2804 cgroup_attach_task+0x47f/0x840 kernel/cgroup/cgroup.c:2908 __cgroup1_procs_write+0x2e3/0x430 kernel/cgroup/cgroup-v1.c:528 cgroup1_procs_write+0x2e/0x40 kernel/cgroup/cgroup-v1.c:541 cgroup_file_write+0x298/0x5a0 kernel/cgroup/cgroup.c:4142 kernfs_fop_write_iter+0x2c8/0x410 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xcaf/0x1120 fs/read_write.c:679 ksys_write+0x18c/0x2b0 fs/read_write.c:731 page last free pid 339 tgid 339 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xa42/0xac0 mm/page_alloc.c:2659 __free_pages+0x5f/0xe0 mm/page_alloc.c:4840 vfree+0x374/0x520 mm/vmalloc.c:3383 kcov_put kernel/kcov.c:439 [inline] kcov_close+0x2c/0x50 kernel/kcov.c:535 __fput+0x24a/0xaa0 fs/file_table.c:450 ____fput+0x20/0x30 fs/file_table.c:478 task_work_run+0x24f/0x300 kernel/task_work.c:239 exit_task_work include/linux/task_work.h:43 [inline] do_exit+0xb3d/0x2ad0 kernel/exit.c:938 do_group_exit+0x21f/0x2e0 kernel/exit.c:1087 get_signal+0x1560/0x16b0 kernel/signal.c:3017 arch_do_signal_or_restart+0x96/0x790 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x63/0x110 kernel/entry/common.c:218 do_syscall_64+0x60/0xf0 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x76/0x7e Memory state around the buggy address: ffff88812bbef900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812bbef980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88812bbefa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88812bbefa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88812bbefb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.