================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x868/0xcf0 kernel/bpf/stackmap.c:265 Write of size 8 at addr ffff888143b2c258 by task syz.2.951/9588 CPU: 0 UID: 0 PID: 9588 Comm: syz.2.951 Not tainted 6.17.0-rc1-syzkaller-ge4414b01c1cd #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __bpf_get_stackid+0x868/0xcf0 kernel/bpf/stackmap.c:265 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1810 [inline] bpf_get_stackid_raw_tp+0x196/0x210 kernel/trace/bpf_trace.c:1799 bpf_prog_b724608cae728045+0x27/0x2f bpf_dispatcher_nop_func include/linux/bpf.h:1332 [inline] __bpf_prog_run include/linux/filter.h:718 [inline] bpf_prog_run include/linux/filter.h:725 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2257 [inline] bpf_trace_run2+0x284/0x4b0 kernel/trace/bpf_trace.c:2298 __do_trace_kfree include/trace/events/kmem.h:94 [inline] trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0x3a0/0x440 mm/slub.c:4866 slab_free_after_rcu_debug+0x60/0x2a0 mm/slub.c:4717 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x283/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:perf_swevent_event+0x10e/0x5e0 kernel/events/core.c:10470 Code: 81 e6 00 01 00 00 31 ff e8 9f 49 d0 ff 48 81 e3 00 01 00 00 75 1e e8 b1 44 d0 ff e9 c2 00 00 00 e8 a7 44 d0 ff e9 70 04 00 00 9d 44 d0 ff e9 66 04 00 00 4d 8d b7 00 01 00 00 4c 89 f0 48 c1 RSP: 0018:ffffc9001b07ee60 EFLAGS: 00000246 RAX: ffffffff81ef66b6 RBX: 1ffff9200360fdd4 RCX: ffff8880306a3c00 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9001b07ef30 R08: ffffc9001b07efd7 R09: 0000000000000000 R10: ffffc9001b07efc8 R11: fffff5200360fdfb R12: 0000000000000001 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888055b412c0 perf_tp_event+0x4f6/0x1380 kernel/events/core.c:10992 perf_trace_run_bpf_submit+0xee/0x170 kernel/events/core.c:10916 do_perf_trace_lock include/trace/events/lock.h:50 [inline] perf_trace_lock+0x2f8/0x3b0 include/trace/events/lock.h:50 __do_trace_lock_release include/trace/events/lock.h:69 [inline] trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x3b2/0x3e0 kernel/locking/lockdep.c:5879 rcu_lock_release include/linux/rcupdate.h:341 [inline] rcu_read_unlock include/linux/rcupdate.h:871 [inline] percpu_ref_put_many include/linux/percpu-refcount.h:337 [inline] percpu_ref_put+0xf9/0x180 include/linux/percpu-refcount.h:351 obj_cgroup_put include/linux/memcontrol.h:784 [inline] __memcg_slab_free_hook+0x12f/0x3d0 mm/memcontrol.c:3218 memcg_slab_free_hook mm/slub.c:2242 [inline] slab_free mm/slub.c:4677 [inline] kfree+0x255/0x440 mm/slub.c:4879 compute_scc+0xf04/0xfa0 kernel/bpf/verifier.c:24562 bpf_check+0x173f6/0x1d2d0 kernel/bpf/verifier.c:24691 bpf_prog_load+0x1318/0x1930 kernel/bpf/syscall.c:2979 __sys_bpf+0x528/0x870 kernel/bpf/syscall.c:6029 __do_sys_bpf kernel/bpf/syscall.c:6139 [inline] __se_sys_bpf kernel/bpf/syscall.c:6137 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6137 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdd6518ebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdd65f49038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fdd653b5fa0 RCX: 00007fdd6518ebe9 RDX: 0000000000000048 RSI: 00002000000017c0 RDI: 0000000000000005 RBP: 00007fdd65211e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdd653b6038 R14: 00007fdd653b5fa0 R15: 00007ffc2eac6a18 Allocated by task 9588: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_node_noprof+0x276/0x4e0 mm/slub.c:4371 kmalloc_node_noprof include/linux/slab.h:932 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:393 [inline] bpf_map_area_alloc+0x64/0x180 kernel/bpf/syscall.c:406 prealloc_elems_and_freelist+0x86/0x1d0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x33f/0x4c0 kernel/bpf/stackmap.c:114 map_create+0xaa0/0x14d0 kernel/bpf/syscall.c:1480 __sys_bpf+0x60f/0x870 kernel/bpf/syscall.c:6011 __do_sys_bpf kernel/bpf/syscall.c:6139 [inline] __se_sys_bpf kernel/bpf/syscall.c:6137 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6137 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888143b2c000 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 24 bytes to the right of allocated 576-byte region [ffff888143b2c000, ffff888143b2c240) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x143b28 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88814e305201 flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000040 ffff88801a44b280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000000f5000000 ffff88814e305201 head: 057ff00000000040 ffff88801a44b280 dead000000000122 0000000000000000 head: 0000000000000000 0000000080100010 00000000f5000000 ffff88814e305201 head: 057ff00000000003 ffffea00050eca01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 9396, tgid 9395 (syz.4.902), ts 271039318424, free_ts 261781418941 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_slab_page mm/slub.c:2489 [inline] allocate_slab+0x65/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __kmalloc_cache_node_noprof+0x29a/0x3d0 mm/slub.c:4404 kmalloc_node_noprof include/linux/slab.h:928 [inline] alloc_mem_cgroup_per_node_info mm/memcontrol.c:3664 [inline] mem_cgroup_alloc mm/memcontrol.c:3746 [inline] mem_cgroup_css_alloc+0x4b2/0x1f20 mm/memcontrol.c:3791 css_create kernel/cgroup/cgroup.c:5669 [inline] cgroup_apply_control_enable+0x3d1/0xa80 kernel/cgroup/cgroup.c:3289 cgroup_mkdir+0xc40/0xe60 kernel/cgroup/cgroup.c:5893 kernfs_iop_mkdir+0x211/0x350 fs/kernfs/dir.c:1268 vfs_mkdir+0x303/0x510 fs/namei.c:4366 do_mkdirat+0x247/0x590 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4414 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9163 tgid 9162 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 __slab_free+0x303/0x3c0 mm/slub.c:4591 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] __kmalloc_cache_noprof+0x1be/0x3d0 mm/slub.c:4391 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] ref_tracker_alloc+0x133/0x460 lib/ref_tracker.c:271 register_netdevice+0x14a3/0x1ae0 net/core/dev.c:11213 register_netdev+0x40/0x60 net/core/dev.c:11305 vti6_init_net+0x238/0x370 net/ipv6/ip6_vti.c:1158 ops_init+0x359/0x5c0 net/core/net_namespace.c:136 setup_net+0x10c/0x320 net/core/net_namespace.c:438 copy_net_ns+0x31b/0x4d0 net/core/net_namespace.c:570 create_new_namespaces+0x3f3/0x720 kernel/nsproxy.c:110 copy_namespaces+0x438/0x4b0 kernel/nsproxy.c:175 copy_process+0x1733/0x3c00 kernel/fork.c:2178 Memory state around the buggy address: ffff888143b2c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888143b2c180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888143b2c200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff888143b2c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888143b2c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 81 e6 00 01 00 00 and $0x100,%esi 6: 31 ff xor %edi,%edi 8: e8 9f 49 d0 ff call 0xffd049ac d: 48 81 e3 00 01 00 00 and $0x100,%rbx 14: 75 1e jne 0x34 16: e8 b1 44 d0 ff call 0xffd044cc 1b: e9 c2 00 00 00 jmp 0xe2 20: e8 a7 44 d0 ff call 0xffd044cc 25: e9 70 04 00 00 jmp 0x49a * 2a: e8 9d 44 d0 ff call 0xffd044cc <-- trapping instruction 2f: e9 66 04 00 00 jmp 0x49a 34: 4d 8d b7 00 01 00 00 lea 0x100(%r15),%r14 3b: 4c 89 f0 mov %r14,%rax 3e: 48 rex.W 3f: c1 .byte 0xc1