================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6bf/0x900 kernel/bpf/stackmap.c:271 Write of size 32 at addr ffff88802ed91610 by task syz.2.2051/12394 CPU: 1 PID: 12394 Comm: syz.2.2051 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xac/0x220 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x288/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 __bpf_get_stackid+0x6bf/0x900 kernel/bpf/stackmap.c:271 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1892 [inline] bpf_get_stackid_raw_tp+0x196/0x200 kernel/trace/bpf_trace.c:1881 bpf_prog_e95a4a16f042d2d7+0x29/0x2d bpf_dispatcher_nop_func include/linux/bpf.h:1224 [inline] __bpf_prog_run include/linux/filter.h:612 [inline] bpf_prog_run include/linux/filter.h:619 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline] bpf_trace_run5+0x20f/0x420 kernel/trace/bpf_trace.c:2364 __bpf_trace_neigh_create+0x1d7/0x250 include/trace/events/neigh.h:23 trace_neigh_create include/trace/events/neigh.h:23 [inline] ___neigh_create+0x23c7/0x2440 net/core/neighbour.c:650 ip6_finish_output2+0x159e/0x1650 net/ipv6/ip6_output.c:132 ip6_send_skb+0x1d5/0x380 net/ipv6/ip6_output.c:2038 icmp6_send+0x12ec/0x1990 net/ipv6/icmp.c:632 icmpv6_param_prob_reason+0x32/0x50 net/ipv6/icmp.c:652 ip6_tlvopt_unknown net/ipv6/exthdrs.c:93 [inline] ip6_parse_tlv+0x1843/0x1b40 net/ipv6/exthdrs.c:-1 ipv6_parse_hopopts+0x303/0x5f0 net/ipv6/exthdrs.c:1060 ip6_rcv_core+0x1089/0x1740 net/ipv6/ip6_input.c:280 ipv6_rcv+0x72/0xc0 net/ipv6/ip6_input.c:307 __netif_receive_skb_one_core net/core/dev.c:5608 [inline] __netif_receive_skb+0xcc/0x290 net/core/dev.c:5722 netif_receive_skb_internal net/core/dev.c:5808 [inline] netif_receive_skb+0x1bc/0x6f0 net/core/dev.c:5867 tun_rx_batched+0x1ba/0x730 drivers/net/tun.c:1556 tun_get_user+0x283f/0x3bf0 drivers/net/tun.c:2009 tun_chr_write_iter+0x119/0x200 drivers/net/tun.c:2055 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x43b/0x940 fs/read_write.c:584 ksys_write+0x147/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f1cc918efc9 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:00007f1cc9fc2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f1cc93e5fa0 RCX: 00007f1cc918efc9 RDX: 000000000000fdef RSI: 0000200000000000 RDI: 00000000000000c8 RBP: 00007f1cc9211f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f1cc93e6038 R14: 00007f1cc93e5fa0 R15: 00007ffc6e619ae8 Allocated by task 12394: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc_node+0xb4/0x230 mm/slab_common.c:1014 kmalloc_node include/linux/slab.h:620 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:303 [inline] bpf_map_area_alloc+0x5e/0x110 kernel/bpf/syscall.c:316 prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x33a/0x4c0 kernel/bpf/stackmap.c:114 map_create+0x877/0x12f0 kernel/bpf/syscall.c:1247 __sys_bpf+0x5f0/0x800 kernel/bpf/syscall.c:5455 __do_sys_bpf kernel/bpf/syscall.c:5577 [inline] __se_sys_bpf kernel/bpf/syscall.c:5575 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5575 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88802ed91600 which belongs to the cache kmalloc-cg-32 of size 32 The buggy address is located 16 bytes inside of allocated 24-byte region [ffff88802ed91600, ffff88802ed91618) The buggy address belongs to the physical page: page:ffffea0000bb6440 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802ed91c00 pfn:0x2ed91 memcg:ffff8880249c3c01 ksm flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff88801784d8c0 ffffea0000963980 dead000000000003 raw: ffff88802ed91c00 000000008040003e 00000001ffffffff ffff8880249c3c01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x116cc0(GFP_USER|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY), pid 5805, tgid 5805 (udevd), ts 100443334520, free_ts 100375803663 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554 prep_new_page mm/page_alloc.c:1561 [inline] get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457 alloc_slab_page+0x5d/0x170 mm/slub.c:1881 allocate_slab mm/slub.c:2028 [inline] new_slab+0x87/0x2e0 mm/slub.c:2081 ___slab_alloc+0xc6d/0x1300 mm/slub.c:3253 __slab_alloc mm/slub.c:3339 [inline] __slab_alloc_node mm/slub.c:3392 [inline] slab_alloc_node mm/slub.c:3485 [inline] __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3534 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0xa4/0x240 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] inotify_handle_inode_event+0x18a/0x560 fs/notify/inotify/inotify_fsnotify.c:96 inotify_ignored_and_remove_idr+0x29/0x70 fs/notify/inotify/inotify_user.c:527 __do_sys_inotify_rm_watch fs/notify/inotify/inotify_user.c:817 [inline] __se_sys_inotify_rm_watch+0x150/0x210 fs/notify/inotify/inotify_user.c:794 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1154 [inline] free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2475 release_pages+0x1fa0/0x2220 mm/swap.c:1022 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline] tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu+0x368/0x4f0 mm/mmu_gather.c:300 tlb_finish_mmu+0xc3/0x1d0 mm/mmu_gather.c:392 exit_mmap+0x3f0/0xb50 mm/mmap.c:3315 __mmput+0x118/0x3c0 kernel/fork.c:1355 exit_mm+0x1da/0x2c0 kernel/exit.c:569 do_exit+0x88e/0x23c0 kernel/exit.c:870 do_group_exit+0x21b/0x2d0 kernel/exit.c:1024 get_signal+0x12fc/0x1400 kernel/signal.c:2902 arch_do_signal_or_restart+0x9c/0x7b0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xf6/0x180 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff88802ed91500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88802ed91580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88802ed91600: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88802ed91680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88802ed91700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================