================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6bf/0x900 kernel/bpf/stackmap.c:271 Write of size 56 at addr ffff88804e875b90 by task syz.2.5905/25792 CPU: 1 PID: 25792 Comm: syz.2.5905 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: <#DB> dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 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+0x241/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_pe kernel/bpf/stackmap.c:362 [inline] bpf_get_stackid_pe+0x343/0x410 kernel/bpf/stackmap.c:331 bpf_prog_ebdd8313a69a195f+0x30/0x45 bpf_dispatcher_nop_func include/linux/bpf.h:1224 [inline] __bpf_prog_run include/linux/filter.h:616 [inline] bpf_prog_run include/linux/filter.h:623 [inline] bpf_overflow_handler+0x1fc/0x510 kernel/events/core.c:10584 __perf_event_overflow+0x447/0x630 kernel/events/core.c:9720 perf_swevent_overflow kernel/events/core.c:9803 [inline] perf_swevent_event+0x319/0x570 kernel/events/core.c:9854 perf_bp_event+0x319/0x430 kernel/events/core.c:10781 hw_breakpoint_handler arch/x86/kernel/hw_breakpoint.c:555 [inline] hw_breakpoint_exceptions_notify+0x23e/0x670 arch/x86/kernel/hw_breakpoint.c:586 notifier_call_chain+0x197/0x380 kernel/notifier.c:93 atomic_notifier_call_chain+0xda/0x180 kernel/notifier.c:231 notify_die+0x145/0x1a0 kernel/notifier.c:596 notify_debug+0x2e/0x50 arch/x86/kernel/traps.c:1042 exc_debug_kernel arch/x86/kernel/traps.c:1099 [inline] exc_debug+0xde/0x140 arch/x86/kernel/traps.c:1199 asm_exc_debug+0x1e/0x40 arch/x86/include/asm/idtentry.h:644 RIP: 0010:copy_iovec_from_user lib/iov_iter.c:1383 [inline] RIP: 0010:__import_iovec_ubuf lib/iov_iter.c:1449 [inline] RIP: 0010:__import_iovec+0x190/0x850 lib/iov_iter.c:1468 Code: 99 b6 fd 48 c7 03 00 00 00 00 4c 89 fb e9 d3 04 00 00 4d 85 e4 0f 88 5d 05 00 00 0f 01 cb 0f ae e8 4d 8b 7c 24 08 49 8b 1c 24 <31> ff 4c 89 fe e8 06 66 5e fd 4d 85 ff 0f 88 4d 05 00 00 e8 b8 61 RSP: 0018:ffffc9001030faa0 EFLAGS: 00040206 RAX: 1ffff92002061fac RBX: 0000200000000200 RCX: 0000000000000002 RDX: ffff8880247b8000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: 0000000000000008 R08: ffffc9001030fd60 R09: ffffc9001030fe30 R10: ffffc9001030fe70 R11: fffff52002061fd0 R12: 0000200000000300 R13: dffffc0000000000 R14: ffffc9001030fcc0 R15: 0000000000000039 import_iovec+0x73/0xa0 lib/iov_iter.c:1535 copy_msghdr_from_user net/socket.c:2531 [inline] sendmsg_copy_msghdr net/socket.c:2625 [inline] ___sys_sendmsg+0x256/0x360 net/socket.c:2644 __sys_sendmsg net/socket.c:2677 [inline] __do_sys_sendmsg net/socket.c:2686 [inline] __se_sys_sendmsg+0x1c2/0x2b0 net/socket.c:2684 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f5773b9ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5774af1028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5773e15fa0 RCX: 00007f5773b9ce59 RDX: 0000000000000000 RSI: 00002000000002c0 RDI: 0000000000000010 RBP: 00007f5773c32d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5773e16038 R14: 00007f5773e15fa0 R15: 00007ffe736af918 Allocated by task 25792: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384 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+0x651/0x890 kernel/bpf/syscall.c:5459 __do_sys_bpf kernel/bpf/syscall.c:5581 [inline] __se_sys_bpf kernel/bpf/syscall.c:5579 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5579 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88804e875b80 which belongs to the cache kmalloc-cg-64 of size 64 The buggy address is located 16 bytes inside of allocated 40-byte region [ffff88804e875b80, ffff88804e875ba8) The buggy address belongs to the physical page: page:ffffea00013a1d40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4e875 memcg:ffff88802b854e01 anon flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888017c4da00 ffffea0001eee980 0000000000000005 raw: 0000000000000000 0000000080200020 00000001ffffffff ffff88802b854e01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 24429, tgid 24429 (syz.2.5418), ts 1358635184182, free_ts 1357380149620 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1581 prep_new_page mm/page_alloc.c:1588 [inline] get_page_from_freelist+0x1951/0x19e0 mm/page_alloc.c:3220 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4500 alloc_slab_page+0x5d/0x160 mm/slub.c:1881 allocate_slab mm/slub.c:2028 [inline] new_slab+0x87/0x2d0 mm/slub.c:2081 ___slab_alloc+0xc5d/0x12f0 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+0x19e/0x250 mm/slub.c:3534 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] alloc_fdtable+0xca/0x2c0 fs/file.c:147 dup_fd+0x786/0xa50 fs/file.c:346 unshare_fd kernel/fork.c:3373 [inline] unshare_files+0x8a/0x140 kernel/fork.c:3526 do_coredump+0x16f5/0x24d0 fs/coredump.c:817 get_signal+0x1133/0x13f0 kernel/signal.c:2888 arch_do_signal_or_restart+0xc2/0x800 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1181 [inline] free_unref_page_prepare+0x7b2/0x8c0 mm/page_alloc.c:2365 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2504 release_pages+0x1f7a/0x2200 mm/swap.c:1022 tlb_batch_pages_flush mm/mmu_gather.c:99 [inline] tlb_flush_mmu_free mm/mmu_gather.c:294 [inline] tlb_flush_mmu+0x379/0x510 mm/mmu_gather.c:301 tlb_finish_mmu+0xf9/0x220 mm/mmu_gather.c:425 exit_mmap+0x428/0xb90 mm/mmap.c:3315 __mmput+0x118/0x3c0 kernel/fork.c:1356 exit_mm+0x24a/0x350 kernel/exit.c:570 do_exit+0x8dd/0x2460 kernel/exit.c:871 do_group_exit+0x21b/0x2d0 kernel/exit.c:1025 get_signal+0x12fc/0x13f0 kernel/signal.c:2902 arch_do_signal_or_restart+0xc2/0x800 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x9/0x30 kernel/entry/common.c:315 exc_page_fault+0x8c/0x100 arch/x86/mm/fault.c:1519 Memory state around the buggy address: ffff88804e875a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88804e875b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88804e875b80: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88804e875c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88804e875c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 99 cltd 1: b6 fd mov $0xfd,%dh 3: 48 c7 03 00 00 00 00 movq $0x0,(%rbx) a: 4c 89 fb mov %r15,%rbx d: e9 d3 04 00 00 jmp 0x4e5 12: 4d 85 e4 test %r12,%r12 15: 0f 88 5d 05 00 00 js 0x578 1b: 0f 01 cb stac 1e: 0f ae e8 lfence 21: 4d 8b 7c 24 08 mov 0x8(%r12),%r15 26: 49 8b 1c 24 mov (%r12),%rbx * 2a: 31 ff xor %edi,%edi <-- trapping instruction 2c: 4c 89 fe mov %r15,%rsi 2f: e8 06 66 5e fd call 0xfd5e663a 34: 4d 85 ff test %r15,%r15 37: 0f 88 4d 05 00 00 js 0x58a 3d: e8 .byte 0xe8 3e: b8 .byte 0xb8 3f: 61 (bad)