================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6cc/0xcf0 kernel/bpf/stackmap.c:265 Write of size 8 at addr ffff888053f87248 by task syz.3.431/7578 CPU: 0 UID: 0 PID: 7578 Comm: syz.3.431 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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+0x6cc/0xcf0 kernel/bpf/stackmap.c:265 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1628 [inline] bpf_get_stackid_raw_tp+0x196/0x210 kernel/trace/bpf_trace.c:1617 bpf_prog_0269d7a1bf76b886+0x27/0x2f bpf_dispatcher_nop_func include/linux/bpf.h:1350 [inline] __bpf_prog_run include/linux/filter.h:721 [inline] bpf_prog_run include/linux/filter.h:728 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2075 [inline] bpf_trace_run2+0x284/0x4b0 kernel/trace/bpf_trace.c:2116 __do_trace_kfree include/trace/events/kmem.h:97 [inline] trace_kfree include/trace/events/kmem.h:97 [inline] kfree+0x62f/0x6d0 mm/slub.c:6760 skb_release_data+0x62d/0x7c0 net/core/skbuff.c:1087 skb_release_all net/core/skbuff.c:1152 [inline] __kfree_skb net/core/skbuff.c:1166 [inline] sk_skb_reason_drop+0x127/0x170 net/core/skbuff.c:1204 kfree_skb_reason include/linux/skbuff.h:1322 [inline] kfree_skb include/linux/skbuff.h:1331 [inline] ip_tunnel_xmit+0xe76/0x2390 net/ipv4/ip_tunnel.c:-1 __gre_xmit net/ipv4/ip_gre.c:488 [inline] gre_tap_xmit+0x590/0x7a0 net/ipv4/ip_gre.c:776 __netdev_start_xmit include/linux/netdevice.h:5248 [inline] netdev_start_xmit include/linux/netdevice.h:5257 [inline] xmit_one net/core/dev.c:3845 [inline] dev_hard_start_xmit+0x2d4/0x830 net/core/dev.c:3861 sch_direct_xmit+0x241/0x4b0 net/sched/sch_generic.c:344 __dev_xmit_skb net/core/dev.c:4152 [inline] __dev_queue_xmit+0x1857/0x3b50 net/core/dev.c:4729 packet_snd net/packet/af_packet.c:3076 [inline] packet_sendmsg+0x3e33/0x5080 net/packet/af_packet.c:3108 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:742 ____sys_sendmsg+0x505/0x830 net/socket.c:2630 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2684 __sys_sendmsg net/socket.c:2716 [inline] __do_sys_sendmsg net/socket.c:2721 [inline] __se_sys_sendmsg net/socket.c:2719 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2719 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9786f8eec9 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:00007f9787da6038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f97871e5fa0 RCX: 00007f9786f8eec9 RDX: 0000000000000000 RSI: 00002000000000c0 RDI: 0000000000000003 RBP: 00007f9787011f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f97871e6038 R14: 00007f97871e5fa0 R15: 00007ffea54764b8 Allocated by task 7574: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5603 [inline] __kmalloc_node_noprof+0x56d/0x800 mm/slub.c:5609 kmalloc_node_noprof include/linux/slab.h:987 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:395 [inline] bpf_map_area_alloc+0x64/0x180 kernel/bpf/syscall.c:408 prealloc_elems_and_freelist+0x86/0x1d0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x33f/0x4c0 kernel/bpf/stackmap.c:114 map_create+0xaa3/0x1640 kernel/bpf/syscall.c:1497 __sys_bpf+0x5f0/0x860 kernel/bpf/syscall.c:6116 __do_sys_bpf kernel/bpf/syscall.c:6244 [inline] __se_sys_bpf kernel/bpf/syscall.c:6242 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6242 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888053f87000 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 [ffff888053f87000, ffff888053f87240) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53f80 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888030440101 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88813ffb0280 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080100010 00000000f5000000 ffff888030440101 head: 00fff00000000040 ffff88813ffb0280 0000000000000000 dead000000000001 head: 0000000000000000 0000000080100010 00000000f5000000 ffff888030440101 head: 00fff00000000003 ffffea00014fe001 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 5868, tgid 5868 (syz-executor), ts 366955029360, free_ts 366945130839 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3030 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3203 new_slab mm/slub.c:3257 [inline] ___slab_alloc+0xe94/0x1920 mm/slub.c:4627 __slab_alloc+0x65/0x100 mm/slub.c:4746 __slab_alloc_node mm/slub.c:4822 [inline] slab_alloc_node mm/slub.c:5233 [inline] __do_kmalloc_node mm/slub.c:5602 [inline] __kvmalloc_node_noprof+0x6ba/0x910 mm/slub.c:7036 xt_alloc_table_info+0x40/0xb0 net/netfilter/x_tables.c:1193 do_replace net/ipv6/netfilter/ip6_tables.c:1143 [inline] do_ip6t_set_ctl+0x88a/0xce0 net/ipv6/netfilter/ip6_tables.c:1644 nf_setsockopt+0x26c/0x290 net/netfilter/nf_sockopt.c:101 do_sock_setsockopt+0x17c/0x1b0 net/socket.c:2360 __sys_setsockopt net/socket.c:2385 [inline] __do_sys_setsockopt net/socket.c:2391 [inline] __se_sys_setsockopt net/socket.c:2388 [inline] __x64_sys_setsockopt+0x13f/0x1b0 net/socket.c:2388 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5198 tgid 5198 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 discard_slab mm/slub.c:3301 [inline] __put_partials+0x146/0x170 mm/slub.c:3848 put_cpu_partial+0x1f2/0x2e0 mm/slub.c:3923 __slab_free+0x2b9/0x390 mm/slub.c:5882 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:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4946 [inline] slab_alloc_node mm/slub.c:5245 [inline] kmem_cache_alloc_noprof+0x367/0x6e0 mm/slub.c:5252 getname_flags+0xb8/0x540 fs/namei.c:146 do_readlinkat+0xbc/0x500 fs/stat.c:575 __do_sys_readlink fs/stat.c:613 [inline] __se_sys_readlink fs/stat.c:610 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:610 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888053f87100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888053f87180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888053f87200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff888053f87280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888053f87300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================