==================================================================
BUG: KASAN: use-after-free in bq_enqueue kernel/bpf/cpumap.c:749 [inline]
BUG: KASAN: use-after-free in cpu_map_enqueue+0xb6/0x370 kernel/bpf/cpumap.c:775
Read of size 8 at addr ffff88813fe60608 by task syz.3.3933/13396

CPU: 1 PID: 13396 Comm: syz.3.3933 Tainted: G        W          6.1.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:427
 kasan_report+0x136/0x160 mm/kasan/report.c:531
 bq_enqueue kernel/bpf/cpumap.c:749 [inline]
 cpu_map_enqueue+0xb6/0x370 kernel/bpf/cpumap.c:775
 __xdp_do_redirect_frame net/core/filter.c:4315 [inline]
 xdp_do_redirect_frame+0x2f0/0x660 net/core/filter.c:4373
 xdp_test_run_batch net/bpf/test_run.c:314 [inline]
 bpf_test_run_xdp_live+0xbf4/0x1ea0 net/bpf/test_run.c:362
 bpf_prog_test_run_xdp+0x7d1/0x1130 net/bpf/test_run.c:1393
 bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3685
 __sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:5038
 __do_sys_bpf kernel/bpf/syscall.c:5124 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5122 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5122
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f336db85d29
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:00007f336e9a1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f336dd75fa0 RCX: 00007f336db85d29
RDX: 0000000000000050 RSI: 00000000200000c0 RDI: 000000000000000a
RBP: 00007f336dc01aa8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f336dd75fa0 R15: 00007ffdf05665c8
 </TASK>

Allocated by task 13187:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node+0xb3/0x230 mm/slab_common.c:943
 kmalloc_node include/linux/slab.h:589 [inline]
 bpf_map_kmalloc_node+0xce/0x1c0 kernel/bpf/syscall.c:452
 __cpu_map_entry_alloc kernel/bpf/cpumap.c:445 [inline]
 cpu_map_update_elem+0x277/0xf60 kernel/bpf/cpumap.c:603
 map_update_elem+0x503/0x680 kernel/bpf/syscall.c:1463
 __sys_bpf+0x337/0x6c0 kernel/bpf/syscall.c:5008
 __do_sys_bpf kernel/bpf/syscall.c:5124 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5122 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5122
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 13188:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
 put_cpu_map_entry+0x6eb/0x760 kernel/bpf/cpumap.c:161
 cpu_map_kthread_run+0x2887/0x2940 kernel/bpf/cpumap.c:408
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3d0 kernel/workqueue.c:1361
 __queue_work+0xb4b/0xf90 kernel/workqueue.c:1520
 queue_work_on+0x14b/0x250 kernel/workqueue.c:1548
 cpu_map_free+0xd7/0x1b0 kernel/bpf/cpumap.c:641
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Second to last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
 call_rcu+0x163/0xa10 kernel/rcu/tree.c:2845
 __cpu_map_entry_replace+0x74/0x170 kernel/bpf/cpumap.c:556
 cpu_map_free+0xd7/0x1b0 kernel/bpf/cpumap.c:641
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff88813fe60600
 which belongs to the cache kmalloc-cg-256 of size 256
The buggy address is located 8 bytes inside of
 256-byte region [ffff88813fe60600, ffff88813fe60700)

The buggy address belongs to the physical page:
page:ffffea0004ff9800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13fe60
head:ffffea0004ff9800 order:1 compound_mapcount:0 compound_pincount:0
memcg:ffff888030ea5301
flags: 0x17ff00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 017ff00000010200 ffffea0000c00700 dead000000000006 ffff888017c42c80
raw: 0000000000000000 0000000000100010 00000001ffffffff ffff888030ea5301
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x0(), pid 1, tgid 1 (swapper/0), ts 2031756662, free_ts 0
 create_dummy_stack mm/page_owner.c:67 [inline]
 register_early_stack+0x86/0xe0 mm/page_owner.c:83
 init_page_owner+0x3a/0x7db mm/page_owner.c:93
 invoke_init_callbacks mm/page_ext.c:126 [inline]
 page_ext_init+0x732/0x78d mm/page_ext.c:518
 kernel_init_freeable+0x450/0x60f init/main.c:1624
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88813fe60500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88813fe60580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88813fe60600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88813fe60680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88813fe60700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================