==================================================================
BUG: KASAN: use-after-free in cpu_map_generic_redirect+0x1b9/0x5d0 kernel/bpf/cpumap.c:786
Read of size 8 at addr ffff88807b280018 by task kworker/1:19/7741
CPU: 1 PID: 7741 Comm: kworker/1:19 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Workqueue: wg-crypt-wg0 wg_packet_tx_worker
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
cpu_map_generic_redirect+0x1b9/0x5d0 kernel/bpf/cpumap.c:786
xdp_do_generic_redirect_map net/core/filter.c:4189 [inline]
xdp_do_generic_redirect+0x401/0x850 net/core/filter.c:4236
do_xdp_generic+0x4f5/0x6c0 net/core/dev.c:4911
__netif_receive_skb_core+0x1bf1/0x3df0 net/core/dev.c:5316
__netif_receive_skb_one_core net/core/dev.c:5491 [inline]
__netif_receive_skb+0x11c/0x530 net/core/dev.c:5607
process_backlog+0x363/0x7f0 net/core/dev.c:6484
__napi_poll+0xc7/0x440 net/core/dev.c:7043
napi_poll net/core/dev.c:7110 [inline]
net_rx_action+0x617/0xda0 net/core/dev.c:7200
handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
do_softirq+0x162/0x240 kernel/softirq.c:459
__local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:383
wg_socket_send_skb_to_peer+0x172/0x1d0 drivers/net/wireguard/socket.c:184
wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
wg_packet_tx_worker+0x1a1/0x7a0 drivers/net/wireguard/send.c:276
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 6300:
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+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc_node+0x199/0x390 mm/slub.c:4455
kmalloc_node include/linux/slab.h:614 [inline]
bpf_map_kmalloc_node+0xdb/0x160 kernel/bpf/syscall.c:430
__cpu_map_entry_alloc kernel/bpf/cpumap.c:442 [inline]
cpu_map_update_elem+0x273/0xe50 kernel/bpf/cpumap.c:600
map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185
__sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4644
__do_sys_bpf kernel/bpf/syscall.c:4760 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4758 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4758
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1366
__queue_work+0x963/0xd00 kernel/workqueue.c:1532
queue_work_on+0x14b/0x250 kernel/workqueue.c:1559
cpu_map_free+0xd7/0x1b0 kernel/bpf/cpumap.c:638
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Second to last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3007 [inline]
call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087
__cpu_map_entry_replace+0x74/0x170 kernel/bpf/cpumap.c:553
cpu_map_free+0xd7/0x1b0 kernel/bpf/cpumap.c:638
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the object at ffff88807b280000
which belongs to the cache kmalloc-cg-256 of size 256
The buggy address is located 24 bytes inside of
256-byte region [ffff88807b280000, ffff88807b280100)
The buggy address belongs to the page:
page:ffffea0001eca000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807b281600 pfn:0x7b280
head:ffffea0001eca000 order:1 compound_mapcount:0
memcg:ffff888063642901
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888017442c80
raw: ffff88807b281600 000000008010000d 00000001ffffffff ffff888063642901
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6300, ts 127937226654, free_ts 103724317634
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
__alloc_pages+0x272/0x700 mm/page_alloc.c:5465
__alloc_pages_node include/linux/gfp.h:570 [inline]
alloc_slab_page mm/slub.c:1777 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xb1/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
__kmalloc_node+0x1fa/0x390 mm/slub.c:4451
kmalloc_node include/linux/slab.h:614 [inline]
bpf_map_kmalloc_node+0xdb/0x160 kernel/bpf/syscall.c:430
__cpu_map_entry_alloc kernel/bpf/cpumap.c:442 [inline]
cpu_map_update_elem+0x273/0xe50 kernel/bpf/cpumap.c:600
map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185
__sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4644
__do_sys_bpf kernel/bpf/syscall.c:4760 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4758 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4758
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 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+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
free_slab mm/slub.c:2015 [inline]
discard_slab mm/slub.c:2021 [inline]
__unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
do_slab_free mm/slub.c:3487 [inline]
___cache_free+0xe3/0x100 mm/slub.c:3506
qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
getname_flags+0xb8/0x4e0 fs/namei.c:138
user_path_at_empty+0x2a/0x180 fs/namei.c:2882
user_path_at include/linux/namei.h:57 [inline]
vfs_statx+0x106/0x3b0 fs/stat.c:221
vfs_fstatat fs/stat.c:243 [inline]
__do_sys_newfstatat fs/stat.c:411 [inline]
__se_sys_newfstatat fs/stat.c:405 [inline]
__x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Memory state around the buggy address:
ffff88807b27ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b27ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807b280000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807b280080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807b280100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
vkms_vblank_simulate: vblank timer overrun