================================================================== BUG: KASAN: slab-out-of-bounds in stack_map_get_build_id_offset+0x731/0x860 kernel/bpf/stackmap.c:188 Write of size 4 at addr ffff88801de42a40 by task syz.2.57/5594 CPU: 0 PID: 5594 Comm: syz.2.57 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 stack_map_get_build_id_offset+0x731/0x860 kernel/bpf/stackmap.c:188 __bpf_get_stackid+0x55d/0x920 kernel/bpf/stackmap.c:294 ____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1465 [inline] bpf_get_stackid_raw_tp+0x175/0x1b0 kernel/trace/bpf_trace.c:1454 bpf_prog_b724608cae728045+0x1e/0x188 bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1878 [inline] bpf_trace_run2+0x163/0x2e0 kernel/trace/bpf_trace.c:1915 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:118 __traceiter_kfree+0x26/0x40 include/trace/events/kmem.h:118 trace_kfree include/trace/events/kmem.h:118 [inline] kfree+0x25f/0x2a0 mm/slub.c:4554 _free_event+0x822/0xe60 kernel/events/core.c:5161 put_event kernel/events/core.c:5258 [inline] perf_event_release_kernel+0x83e/0x8d0 kernel/events/core.c:5383 perf_release+0x37/0x40 kernel/events/core.c:5393 __fput+0x234/0x930 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f7fbd500e79 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:00007fff5ece5958 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f7fbd76dda0 RCX: 00007f7fbd500e79 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f7fbd76dda0 R08: 00007f7fbd76c038 R09: 0000000000000000 R10: 000000000003fdc0 R11: 0000000000000246 R12: 000000000001a911 R13: 00007f7fbd76c09c R14: 000000000001a858 R15: 00007f7fbd76c090 Allocated by task 5599: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc_node include/linux/slab.h:630 [inline] __bpf_map_area_alloc kernel/bpf/syscall.c:322 [inline] bpf_map_area_alloc+0x47/0xe0 kernel/bpf/syscall.c:335 prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:70 stack_map_alloc+0x3c9/0x570 kernel/bpf/stackmap.c:137 find_and_alloc_map kernel/bpf/syscall.c:129 [inline] map_create+0x485/0x2350 kernel/bpf/syscall.c:881 __sys_bpf+0x30a/0x6f0 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4761 [inline] __se_sys_bpf kernel/bpf/syscall.c:4759 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88801de42800 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 576 bytes inside of 1024-byte region [ffff88801de42800, ffff88801de42c00) The buggy address belongs to the page: page:ffffea0000779000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1de40 head:ffffea0000779000 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88807973f601 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00007d9400 0000000200000002 ffff888016c4c000 raw: 0000000000000000 0000000000100010 00000001ffffffff ffff88807973f601 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 3565, ts 21221646371, free_ts 21215664068 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab mm/slub.c:1917 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1980 ___slab_alloc+0x80a/0xdd0 mm/slub.c:3013 __slab_alloc mm/slub.c:3100 [inline] slab_alloc_node mm/slub.c:3191 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x1cd/0x330 mm/slub.c:4408 kmalloc_array include/linux/slab.h:647 [inline] kcalloc include/linux/slab.h:676 [inline] alloc_pipe_info+0x1f8/0x4b0 fs/pipe.c:811 get_pipe_inode fs/pipe.c:885 [inline] create_pipe_files+0x85/0x700 fs/pipe.c:917 __do_pipe_flags+0x46/0x1f0 fs/pipe.c:966 do_pipe2+0xa7/0x190 fs/pipe.c:1014 __do_sys_pipe2 fs/pipe.c:1032 [inline] __se_sys_pipe2 fs/pipe.c:1030 [inline] __x64_sys_pipe2+0x56/0x60 fs/pipe.c:1030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396 free_slab mm/slub.c:2020 [inline] discard_slab mm/slub.c:2026 [inline] __unfreeze_partials+0x1a5/0x200 mm/slub.c:2512 put_cpu_partial+0x12d/0x190 mm/slub.c:2592 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3225 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x127/0x330 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] tomoyo_realpath_from_path+0x118/0x610 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x23f/0x5d0 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x120 security/security.c:1349 vfs_getattr+0x26/0x3a0 fs/stat.c:157 vfs_fstat fs/stat.c:182 [inline] __do_sys_newfstat fs/stat.c:421 [inline] __se_sys_newfstat fs/stat.c:418 [inline] __x64_sys_newfstat+0x137/0x210 fs/stat.c:418 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88801de42900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801de42980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88801de42a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88801de42a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801de42b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================