==================================================================
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:4305
Read of size 4 at addr ffffc9000345f7f8 by task syz-executor237/5233
CPU: 0 UID: 0 PID: 5233 Comm: syz-executor237 Not tainted 6.10.0-next-20240726-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
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:4305
__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+0x2c4/0x970 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
common_interrupt+0xaa/0xd0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:lock_acquire+0x264/0x550 kernel/locking/lockdep.c:5826
Code: 2b 00 74 08 4c 89 f7 e8 aa 9e 8b 00 f6 44 24 61 02 0f 85 85 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 44 25 00 00 00 00 00 43 c7 44 25 09 00 00 00 00 43 c7 44 25
RSP: 0018:ffffc9000345f3c0 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 1ffff9200068be84 RCX: 05a0a220de09ff00
RDX: dffffc0000000000 RSI: ffffffff8c0ae6c0 RDI: ffffffff8c607c40
RBP: ffffc9000345f518 R08: ffffffff93737807 R09: 1ffffffff26e6f00
R10: dffffc0000000000 R11: fffffbfff26e6f01 R12: 1ffff9200068be80
R13: dffffc0000000000 R14: ffffc9000345f420 R15: 0000000000000246
rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
rcu_read_lock include/linux/rcupdate.h:838 [inline]
page_ext_get+0x3d/0x2a0 mm/page_ext.c:535
page_table_check_clear+0x4b/0x550 mm/page_table_check.c:74
get_and_clear_full_ptes include/linux/pgtable.h:678 [inline]
zap_present_folio_ptes mm/memory.c:1493 [inline]
zap_present_ptes mm/memory.c:1576 [inline]
zap_pte_range mm/memory.c:1618 [inline]
zap_pmd_range mm/memory.c:1736 [inline]
zap_pud_range mm/memory.c:1765 [inline]
zap_p4d_range mm/memory.c:1786 [inline]
unmap_page_range+0x2b48/0x42c0 mm/memory.c:1807
unmap_vmas+0x3cc/0x5f0 mm/memory.c:1897
exit_mmap+0x264/0xc80 mm/mmap.c:3412
__mmput+0x115/0x390 kernel/fork.c:1347
exit_mm+0x220/0x310 kernel/exit.c:571
do_exit+0x9b2/0x27f0 kernel/exit.c:869
do_group_exit+0x207/0x2c0 kernel/exit.c:1031
__do_sys_exit_group kernel/exit.c:1042 [inline]
__se_sys_exit_group kernel/exit.c:1040 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1040
x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232
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:0x7f37ca666c49
Code: Unable to access opcode bytes at 0x7f37ca666c1f.
RSP: 002b:00007ffe2ffe6b88 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f37ca666c49
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007f37ca6e7390 R08: ffffffffffffffb8 R09: 00007ffe2ffe6d18
R10: 00007ffe2ffe6d18 R11: 0000000000000246 R12: 00007f37ca6e7390
R13: 0000000000000000 R14: 00007f37ca6e8e60 R15: 00007f37ca637a80
The buggy address belongs to stack of task syz-executor237/5233
and is located at offset 248 in frame:
unmap_page_range+0x0/0x42c0 include/linux/mm.h:758
This frame has 11 objects:
[32, 40) 'pte.sroa.0.i.i.i.i.i.i.i.i'
[64, 72) 'retval.sroa.0.i.i.i.i.i.i'
[96, 104) 'pte.sroa.0.i.i.i.i.i.i.i.i.i'
[128, 136) 'pte.sroa.0.i.i.i.i.i114.i88.i.i.i.i.i'
[160, 168) 'pte.sroa.0.i.i.i.i.i.i90.i.i.i.i.i'
[192, 200) 'pte.sroa.0.i.i.i.i.i114.i.i.i.i.i.i'
[224, 232) 'pte.sroa.0.i.i.i.i29.i.i.i.i.i.i.i'
[256, 264) 'pte.sroa.0.i.i.i.i.i.i.i.i.i.i.i'
[288, 296) 'retval.sroa.0.i.i.i.i.i'
[320, 336) 'rss.i.i.i.i'
[352, 360) 'ptl.i.i.i.i'
The buggy address belongs to the virtual mapping at
[ffffc90003458000, ffffc90003461000) created by:
copy_process+0x5d1/0x3d90 kernel/fork.c:2206
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2efc6
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 5230, tgid 5230 (syz-executor237), ts 78970731280, free_ts 78949158262
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:3442
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700
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:314 [inline]
dup_task_struct+0x444/0x8c0 kernel/fork.c:1115
copy_process+0x5d1/0x3d90 kernel/fork.c:2206
kernel_clone+0x226/0x8f0 kernel/fork.c:2788
__do_sys_clone kernel/fork.c:2931 [inline]
__se_sys_clone kernel/fork.c:2915 [inline]
__x64_sys_clone+0x258/0x2a0 kernel/fork.c:2915
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
page last free pid 5224 tgid 5224 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:2612
__slab_free+0x31b/0x3d0 mm/slub.c:4384
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3988 [inline]
slab_alloc_node mm/slub.c:4037 [inline]
kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080
__alloc_skb+0x1c3/0x440 net/core/skbuff.c:664
alloc_skb_fclone include/linux/skbuff.h:1370 [inline]
tcp_stream_alloc_skb+0x3d/0x310 net/ipv4/tcp.c:882
tcp_sendmsg_locked+0xd6a/0x4e10 net/ipv4/tcp.c:1164
tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1354
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x1a6/0x270 net/socket.c:745
sock_write_iter+0x2dd/0x400 net/socket.c:1160
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xa72/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
Memory state around the buggy address:
ffffc9000345f680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc9000345f700: f1 f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 f2 f2 f2
>ffffc9000345f780: 00 f2 f2 f2 00 f2 f2 f2 00 f2 f2 f2 00 f2 f2 f2
^
ffffc9000345f800: 00 f2 f2 f2 00 f2 f2 f2 00 00 f2 f2 00 f3 f3 f3
ffffc9000345f880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 2b 00 sub (%rax),%eax
2: 74 08 je 0xc
4: 4c 89 f7 mov %r14,%rdi
7: e8 aa 9e 8b 00 call 0x8b9eb6
c: f6 44 24 61 02 testb $0x2,0x61(%rsp)
11: 0f 85 85 01 00 00 jne 0x19c
17: 41 f7 c7 00 02 00 00 test $0x200,%r15d
1e: 74 01 je 0x21
20: fb sti
21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp)
28: e0 45
* 2a: 4b c7 44 25 00 00 00 movq $0x0,0x0(%r13,%r12,1) <-- trapping instruction
31: 00 00
33: 43 c7 44 25 09 00 00 movl $0x0,0x9(%r13,%r12,1)
3a: 00 00
3c: 43 rex.XB
3d: c7 .byte 0xc7
3e: 44 rex.R
3f: 25 .byte 0x25