================================================================== BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x6fa/0x960 kernel/bpf/stackmap.c:274 Write of size 32 at addr ffff88810e678f60 by task syz.2.18/376 CPU: 0 PID: 376 Comm: syz.2.18 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189 memcpy+0x44/0x70 mm/kasan/shadow.c:66 __bpf_get_stackid+0x6fa/0x960 kernel/bpf/stackmap.c:274 ____bpf_get_stackid_pe kernel/bpf/stackmap.c:377 [inline] bpf_get_stackid_pe+0x350/0x400 kernel/bpf/stackmap.c:334 bpf_prog_ee169d054574282b+0x24/0x39 bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline] __bpf_prog_run include/linux/filter.h:607 [inline] bpf_prog_run include/linux/filter.h:614 [inline] bpf_overflow_handler+0x3c7/0x5e0 kernel/events/core.c:10273 __perf_event_overflow+0x458/0x640 kernel/events/core.c:9448 perf_event_overflow kernel/events/core.c:9469 [inline] perf_swevent_hrtimer+0x4b4/0x540 kernel/events/core.c:10919 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x398/0x890 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x3ad/0x8c0 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1107 [inline] __sysvec_apic_timer_interrupt+0x11e/0x440 arch/x86/kernel/apic/apic.c:1124 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0x53/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:691 RIP: 0033:0x7f73b8466090 Code: 00 00 45 31 d2 48 83 b8 88 00 00 00 ff 41 b9 03 00 00 00 ba 01 00 00 00 0f 85 59 ff ff ff eb ca 66 2e 0f 1f 84 00 00 00 00 00 <80> 3d 4e f6 ed 00 00 74 40 80 3d 33 f6 ed 00 00 74 2e 80 3d 36 f6 RSP: 002b:00007ffc87e46f88 EFLAGS: 00000202 RAX: 0000001b33d24000 RBX: 0000000000000000 RCX: 0000001b33d24000 RDX: 0000000000000006 RSI: 0000000000000007 RDI: 0000000008000700 RBP: 00007f73b8815fb0 R08: 000000000003fd9c R09: 00007f73b8816038 R10: 0000001b33d2421c R11: 0000000000000006 R12: 00007f73b8815fa0 R13: 0000200000000000 R14: 00007ffc87e46f98 R15: 00007f73b8815fa0 Allocated by task 376: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:380 [inline] __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc_node+0xb2/0x1e0 mm/slab_common.c:945 kmalloc_node include/linux/slab.h:589 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline] bpf_map_area_alloc+0x4b/0xe0 kernel/bpf/syscall.c:341 prealloc_elems_and_freelist+0x8a/0x1e0 kernel/bpf/stackmap.c:51 stack_map_alloc+0x398/0x520 kernel/bpf/stackmap.c:117 find_and_alloc_map kernel/bpf/syscall.c:133 [inline] map_create+0x467/0xcf0 kernel/bpf/syscall.c:1126 __sys_bpf+0x34e/0x850 kernel/bpf/syscall.c:4988 __do_sys_bpf kernel/bpf/syscall.c:5110 [inline] __se_sys_bpf kernel/bpf/syscall.c:5108 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5108 x64_sys_call+0x488/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88810e678f00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 96 bytes inside of 128-byte region [ffff88810e678f00, ffff88810e678f80) The buggy address belongs to the physical page: page:ffffea0004399e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e678 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea000439a080 dead000000000002 ffff888100042a80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 2523101082, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672 prep_new_page+0x1c/0x110 mm/page_alloc.c:2679 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4586 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5930 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1967 [inline] new_slab+0x98/0x3e0 mm/slub.c:2020 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177 __slab_alloc+0x5e/0xa0 mm/slub.c:3263 slab_alloc_node mm/slub.c:3348 [inline] __kmem_cache_alloc_node+0x204/0x2d0 mm/slub.c:3423 kmalloc_trace+0x29/0xb0 mm/slab_common.c:1028 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] class_dir_create_and_add drivers/base/core.c:3226 [inline] get_device_parent+0x2f3/0x410 drivers/base/core.c:3290 device_add+0x308/0xec0 drivers/base/core.c:3619 usb_add_gadget+0x330/0x620 drivers/usb/gadget/udc/core.c:1382 usb_add_gadget_udc_release drivers/usb/gadget/udc/core.c:1445 [inline] usb_add_gadget_udc+0x11a/0x150 drivers/usb/gadget/udc/core.c:1492 dummy_udc_probe+0x6e6/0x7f0 drivers/usb/gadget/udc/dummy_hcd.c:1102 platform_probe+0x16d/0x1f0 drivers/base/platform.c:1400 page_owner free stack trace missing Memory state around the buggy address: ffff88810e678e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88810e678e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810e678f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ^ ffff88810e678f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810e679000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== general protection fault, probably for non-canonical address 0xea89c4aac8abe8ca: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0x544e4556455f4650-0x544e4556455f4657] CPU: 0 PID: 776 Comm: syz.2.417 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 RIP: 0010:___pcpu_freelist_pop kernel/bpf/percpu_freelist.c:134 [inline] RIP: 0010:__pcpu_freelist_pop+0x777/0x840 kernel/bpf/percpu_freelist.c:188 Code: 00 74 52 48 89 df e8 78 0a 2a 00 eb 48 e8 a1 7e e4 ff eb 4b e8 9a 7e e4 ff 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 5b 09 2a 00 4d 8b 37 48 b8 00 00 00 RSP: 0000:ffffc900020e7750 EFLAGS: 00010006 RAX: 0a89c8aac8abe8ca RBX: ffffe8ffffd10060 RCX: dffffc0000000000 RDX: 0000000000010000 RSI: 0000000000000004 RDI: ffffc900020e76e0 RBP: ffffc900020e7790 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff5200041cedc R12: ffffe8ffffd10068 R13: 1ffffd1ffffa200c R14: 0000000000000001 R15: 544e4556455f4652 FS: 0000555555e52500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000008ab CR3: 0000000118aac000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: pcpu_freelist_pop+0x8a/0xf0 kernel/bpf/percpu_freelist.c:197 __bpf_get_stackid+0x6d5/0x960 kernel/bpf/stackmap.c:271 ____bpf_get_stackid_pe kernel/bpf/stackmap.c:377 [inline] bpf_get_stackid_pe+0x350/0x400 kernel/bpf/stackmap.c:334 bpf_prog_ee169d054574282b+0x24/0x39 bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline] __bpf_prog_run include/linux/filter.h:607 [inline] bpf_prog_run include/linux/filter.h:614 [inline] bpf_overflow_handler+0x3c7/0x5e0 kernel/events/core.c:10273 __perf_event_overflow+0x458/0x640 kernel/events/core.c:9448 perf_event_overflow kernel/events/core.c:9469 [inline] perf_swevent_hrtimer+0x4b4/0x540 kernel/events/core.c:10919 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x398/0x890 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x3ad/0x8c0 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1107 [inline] __sysvec_apic_timer_interrupt+0x11e/0x440 arch/x86/kernel/apic/apic.c:1124 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0x53/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:691 RIP: 0033:0x7f73b8466112 Code: 89 de bf ff ff ff ff 44 0f b6 05 b9 f5 ed 00 e8 94 f4 ff ff 80 3d e2 f5 ed 00 00 74 c9 48 89 df 5b e9 32 36 ff ff 66 90 41 57 <41> 56 41 55 41 54 49 89 fc 55 53 48 83 ec 18 8b 47 08 85 c0 0f 85 RSP: 002b:00007ffc87e46fd0 EFLAGS: 00000217 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f73b859ce59 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f73b8815fa0 RBP: 00000000000008ab R08: 0009e15cfdd0f140 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f73b8815fac R14: 00007f73b8815fa8 R15: 00007f73b8815fa0 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:___pcpu_freelist_pop kernel/bpf/percpu_freelist.c:134 [inline] RIP: 0010:__pcpu_freelist_pop+0x777/0x840 kernel/bpf/percpu_freelist.c:188 Code: 00 74 52 48 89 df e8 78 0a 2a 00 eb 48 e8 a1 7e e4 ff eb 4b e8 9a 7e e4 ff 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ff e8 5b 09 2a 00 4d 8b 37 48 b8 00 00 00 RSP: 0000:ffffc900020e7750 EFLAGS: 00010006 RAX: 0a89c8aac8abe8ca RBX: ffffe8ffffd10060 RCX: dffffc0000000000 RDX: 0000000000010000 RSI: 0000000000000004 RDI: ffffc900020e76e0 RBP: ffffc900020e7790 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff5200041cedc R12: ffffe8ffffd10068 R13: 1ffffd1ffffa200c R14: 0000000000000001 R15: 544e4556455f4652 FS: 0000555555e52500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000008ab CR3: 0000000118aac000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 74 52 48 add %dh,0x48(%rdx,%rdx,2) 4: 89 df mov %ebx,%edi 6: e8 78 0a 2a 00 call 0x2a0a83 b: eb 48 jmp 0x55 d: e8 a1 7e e4 ff call 0xffe47eb3 12: eb 4b jmp 0x5f 14: e8 9a 7e e4 ff call 0xffe47eb3 19: 4c 89 f8 mov %r15,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 27: fc ff df * 2a: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping instruction 2e: 74 08 je 0x38 30: 4c 89 ff mov %r15,%rdi 33: e8 5b 09 2a 00 call 0x2a0993 38: 4d 8b 37 mov (%r15),%r14 3b: 48 rex.W 3c: b8 .byte 0xb8 3d: 00 00 add %al,(%rax)