==================================================================
BUG: KASAN: stack-out-of-bounds in bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline]
BUG: KASAN: stack-out-of-bounds in xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4298
Read of size 4 at addr ffffc9000372f7f8 by task syz.2.944/9756
CPU: 0 UID: 0 PID: 9756 Comm: syz.2.944 Not tainted 6.10.0-syzkaller-12381-gc33ffdb70cc6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline]
xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4298
__napi_poll+0xe4/0x490 net/core/dev.c:6774
napi_poll net/core/dev.c:6840 [inline]
net_rx_action+0x89b/0x1240 net/core/dev.c:6962
handle_softirqs+0x2c6/0x970 kernel/softirq.c:554
do_softirq+0x11b/0x1e0 kernel/softirq.c:455
__local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382
local_bh_enable include/linux/bottom_half.h:33 [inline]
tun_get_user+0x2884/0x4720 drivers/net/tun.c:1936
tun_chr_write_iter+0x113/0x1f0 drivers/net/tun.c:2052
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xa74/0xc90 fs/read_write.c:590
ksys_write+0x1a0/0x2c0 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f01af574a9f
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 29 8c 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 7c 8c 02 00 48
RSP: 002b:00007f01b032b010 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f01af7061e8 RCX: 00007f01af574a9f
RDX: 0000000000011dc0 RSI: 0000000020000100 RDI: 00000000000000c8
RBP: 00007f01af5e4e68 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000011dc0 R11: 0000000000000293 R12: 0000000000000000
R13: 000000000000006e R14: 00007f01af7061e8 R15: 00007ffcc9e99ad8
The buggy address belongs to stack of task syz.2.944/9756
and is located at offset 88 in frame:
do_softirq+0x0/0x1e0
This frame has 2 objects:
[32, 40) 'flags.i.i.i105'
[64, 72) 'flags.i.i.i'
The buggy address belongs to the virtual mapping at
[ffffc90003728000, ffffc90003731000) created by:
copy_process+0x5d1/0x3dc0 kernel/fork.c:2204
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806d3b6000 pfn:0x6d3b0
memcg:ffff88801d771c02
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff88806d3b6000 0000000000000000 00000001ffffffff ffff88801d771c02
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 2, tgid 2 (kthreadd), ts 635603903738, free_ts 634767773516
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493
prep_new_page mm/page_alloc.c:1501 [inline]
get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3438
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263
vm_area_alloc_pages mm/vmalloc.c:3584 [inline]
__vmalloc_area_node mm/vmalloc.c:3660 [inline]
__vmalloc_node_range_noprof+0x971/0x1460 mm/vmalloc.c:3841
alloc_thread_stack_node kernel/fork.c:313 [inline]
dup_task_struct+0x444/0x8c0 kernel/fork.c:1113
copy_process+0x5d1/0x3dc0 kernel/fork.c:2204
kernel_clone+0x226/0x8f0 kernel/fork.c:2781
kernel_thread+0x1bc/0x240 kernel/fork.c:2843
create_kthread kernel/kthread.c:412 [inline]
kthreadd+0x60d/0x810 kernel/kthread.c:765
ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 9707 tgid 9707 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_page+0xd22/0xea0 mm/page_alloc.c:2608
vfree+0x186/0x2e0 mm/vmalloc.c:3364
do_free_pages sound/core/pcm_memory.c:89 [inline]
snd_pcm_lib_free_pages+0x1cc/0x2a0 sound/core/pcm_memory.c:493
do_hw_free sound/core/pcm_native.c:894 [inline]
snd_pcm_release_substream+0x2c6/0x490 sound/core/pcm_native.c:2714
snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2398 [inline]
snd_pcm_oss_release+0x1a8/0x280 sound/core/oss/pcm_oss.c:2577
__fput+0x24c/0x8a0 fs/file_table.c:422
task_work_run+0x251/0x310 kernel/task_work.c:222
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffffc9000372f680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc9000372f700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc9000372f780: 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 f3 f3 f3
^
ffffc9000372f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc9000372f880: f1 f1 f1 f1 00 f3 f3 f3 00 00 00 00 00 00 00 00
==================================================================