================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x677/0xcf0 kernel/bpf/stackmap.c:265 Write of size 8 at addr ffff888079491a48 by task syz.3.243/6340 CPU: 1 UID: 0 PID: 6340 Comm: syz.3.243 Not tainted syzkaller #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+0x677/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:1335 [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+0x281/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 ieee80211_inform_bss+0xbd9/0x10a0 net/mac80211/scan.c:160 rdev_inform_bss net/wireless/rdev-ops.h:418 [inline] cfg80211_inform_single_bss_data+0xd05/0x1ac0 net/wireless/scan.c:2379 cfg80211_inform_bss_data+0x1fb/0x3b30 net/wireless/scan.c:3234 cfg80211_inform_bss_frame_data+0x3d7/0x730 net/wireless/scan.c:3325 ieee80211_bss_info_update+0x746/0x9e0 net/mac80211/scan.c:226 ieee80211_scan_rx+0x593/0xa20 net/mac80211/scan.c:355 __ieee80211_rx_handle_packet net/mac80211/rx.c:5186 [inline] ieee80211_rx_list+0x201c/0x2a90 net/mac80211/rx.c:5423 ieee80211_rx_napi+0x1a8/0x3d0 net/mac80211/rx.c:5446 ieee80211_rx include/net/mac80211.h:5210 [inline] ieee80211_handle_queued_frames+0xe8/0x1f0 net/mac80211/main.c:453 tasklet_action_common+0x369/0x580 kernel/softirq.c:829 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:jhash2 include/linux/jhash.h:129 [inline] RIP: 0010:hash_stack lib/stackdepot.c:563 [inline] RIP: 0010:stack_depot_save_flags+0xba/0x860 lib/stackdepot.c:664 Code: 31 c0 01 ef 45 89 c1 41 c1 c1 08 44 29 c5 41 31 e9 41 01 f8 44 29 cf 44 89 c9 c1 c1 10 31 f9 45 01 c1 89 c8 c1 c0 13 41 29 c8 <44> 31 c0 44 01 c9 41 29 c1 89 c5 c1 c5 04 44 31 cd 01 c8 83 c6 fd RSP: 0018:ffffc90003c0f908 EFLAGS: 00000296 RAX: 000000007151c86d RBX: 0000000000000000 RCX: 00000000390dae2a RDX: ffffc90003c0f988 RSI: 000000000000000c RDI: 00000000f0713105 RBP: 0000000087b3ff16 R08: 00000000c0abe88d R09: 0000000098e96033 R10: 0000000000000009 R11: ffffffff81ac3930 R12: 0000000000000001 R13: 0000000000000000 R14: ffffc90003c0f970 R15: ffffc90003c0f970 kasan_save_stack+0x4d/0x60 mm/kasan/common.c:48 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:548 task_work_add+0xb1/0x420 kernel/task_work.c:65 __fput_deferred+0x154/0x390 fs/file_table.c:529 fput_close+0x119/0x200 fs/file_table.c:585 filp_close+0x27/0x40 fs/open.c:1561 __range_close fs/file.c:767 [inline] __do_sys_close_range fs/file.c:826 [inline] __se_sys_close_range+0x359/0x650 fs/file.c:790 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:0x7f1a02f8ebe9 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:00007ffe22f5a768 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: ffffffffffffffda RBX: 000000000001c4d4 RCX: 00007f1a02f8ebe9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000522f5aa5f R10: 0000001b31c20000 R11: 0000000000000246 R12: 00007f1a031c5fac R13: 00007f1a031c5fa0 R14: ffffffffffffffff R15: 0000000000000005 Allocated by task 6340: 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 ffff888079491800 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 8 bytes to the right of allocated 576-byte region [ffff888079491800, ffff888079491a40) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79490 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888059290201 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a44b280 ffffea0000c5e000 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 ffff888059290201 head: 00fff00000000040 ffff88801a44b280 ffffea0000c5e000 dead000000000002 head: 0000000000000000 0000000080100010 00000000f5000000 ffff888059290201 head: 00fff00000000003 ffffea0001e52401 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5891, tgid 5891 (syz-executor), ts 94934733431, free_ts 94617192401 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_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/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] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] __register_sysctl_table+0x72/0x1340 fs/proc/proc_sysctl.c:1379 ipv6_sysctl_net_init+0x31b/0x4a0 net/ipv6/sysctl_net_ipv6.c:277 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 unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:218 ksys_unshare+0x4c8/0x8c0 kernel/fork.c:3127 __do_sys_unshare kernel/fork.c:3198 [inline] __se_sys_unshare kernel/fork.c:3196 [inline] __x64_sys_unshare+0x38/0x50 kernel/fork.c:3196 page last free pid 5887 tgid 5887 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 discard_slab mm/slub.c:2753 [inline] __put_partials+0x156/0x1a0 mm/slub.c:3218 put_cpu_partial+0x17c/0x250 mm/slub.c:3293 __slab_free+0x2d5/0x3c0 mm/slub.c:4550 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] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x224/0x4f0 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] tomoyo_add_entry security/tomoyo/common.c:2132 [inline] tomoyo_supervisor+0xbd5/0x1480 security/tomoyo/common.c:2204 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x438/0x5a0 security/tomoyo/file.c:734 security_file_ioctl+0xcb/0x2d0 security/security.c:2943 __do_sys_ioctl fs/ioctl.c:592 [inline] __se_sys_ioctl+0x47/0x170 fs/ioctl.c:584 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 Memory state around the buggy address: ffff888079491900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888079491980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888079491a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff888079491a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079491b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 31 c0 xor %eax,%eax 2: 01 ef add %ebp,%edi 4: 45 89 c1 mov %r8d,%r9d 7: 41 c1 c1 08 rol $0x8,%r9d b: 44 29 c5 sub %r8d,%ebp e: 41 31 e9 xor %ebp,%r9d 11: 41 01 f8 add %edi,%r8d 14: 44 29 cf sub %r9d,%edi 17: 44 89 c9 mov %r9d,%ecx 1a: c1 c1 10 rol $0x10,%ecx 1d: 31 f9 xor %edi,%ecx 1f: 45 01 c1 add %r8d,%r9d 22: 89 c8 mov %ecx,%eax 24: c1 c0 13 rol $0x13,%eax 27: 41 29 c8 sub %ecx,%r8d * 2a: 44 31 c0 xor %r8d,%eax <-- trapping instruction 2d: 44 01 c9 add %r9d,%ecx 30: 41 29 c1 sub %eax,%r9d 33: 89 c5 mov %eax,%ebp 35: c1 c5 04 rol $0x4,%ebp 38: 44 31 cd xor %r9d,%ebp 3b: 01 c8 add %ecx,%eax 3d: 83 c6 fd add $0xfffffffd,%esi