==================================================================
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 ffffc900031377f8 by task syz-executor535/5100
CPU: 0 PID: 5100 Comm: syz-executor535 Not tainted 6.10.0-syzkaller-08280-g68b59730459e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
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 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:5757
Code: 2b 00 74 08 4c 89 f7 e8 4a 04 8a 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: 0000:ffffc900031370c0 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 1ffff92000626e24 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffffff8bcadb20 RDI: ffffffff8c205b20
RBP: ffffc90003137210 R08: ffffffff92fe35c7 R09: 1ffffffff25fc6b8
R10: dffffc0000000000 R11: fffffbfff25fc6b9 R12: 1ffff92000626e20
R13: dffffc0000000000 R14: ffffc90003137120 R15: 0000000000000246
__raw_spin_trylock include/linux/spinlock_api_smp.h:90 [inline]
_raw_spin_trylock+0x46/0x80 kernel/locking/spinlock.c:138
spin_trylock include/linux/spinlock.h:361 [inline]
rmqueue_pcplist mm/page_alloc.c:2963 [inline]
rmqueue mm/page_alloc.c:3013 [inline]
get_page_from_freelist+0x79f/0x2f10 mm/page_alloc.c:3422
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
vma_alloc_folio_noprof+0xf3/0x1f0 mm/mempolicy.c:2304
folio_prealloc+0x31/0x170
wp_page_copy mm/memory.c:3285 [inline]
do_wp_page+0x11cc/0x52f0 mm/memory.c:3677
handle_pte_fault+0x117e/0x7090 mm/memory.c:5397
__handle_mm_fault mm/memory.c:5524 [inline]
handle_mm_fault+0x10df/0x1ba0 mm/memory.c:5689
do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
handle_page_fault arch/x86/mm/fault.c:1481 [inline]
exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7fba97a9cc60
Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 8d 63 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 0f b1 15 e0 a1 0a 00 0f 85 0f 02 00 00 4c 8d 25 d3 a1 0a 00 4c
RSP: 002b:00007ffc173d2010 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 00007fba97b43148 RDI: 0000000000000000
RBP: 00007fba97b43148 R08: 00007ffc173d2090 R09: 00007ffc173d2090
R10: 00007ffc173d2090 R11: 0000000000000202 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
The buggy address belongs to stack of task syz-executor535/5100
and is located at offset 56 in frame:
do_wp_page+0x0/0x52f0 include/linux/mm.h:1140
This frame has 7 objects:
[32, 40) 'pte.sroa.0.i.i.i'
[64, 72) 'retval.sroa.0.i.i'
[96, 104) 'retval.sroa.0.i.i.i'
[128, 168) 'range.i'
[208, 216) 'pte.sroa.0.i.i'
[240, 248) 'retval.sroa.0.i299'
[272, 280) 'retval.sroa.0.i'
The buggy address belongs to the virtual mapping at
[ffffc90003130000, ffffc90003139000) created by:
copy_process+0x5d1/0x3dc0 kernel/fork.c:2203
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888015077200 pfn:0x25e8e
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff888015077200 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 4922, tgid 4922 (dhcpcd-run-hook), ts 54971969674, free_ts 40327021523
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473
prep_new_page mm/page_alloc.c:1481 [inline]
get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
vm_area_alloc_pages mm/vmalloc.c:3583 [inline]
__vmalloc_area_node mm/vmalloc.c:3659 [inline]
__vmalloc_node_range_noprof+0x971/0x1460 mm/vmalloc.c:3840
alloc_thread_stack_node kernel/fork.c:311 [inline]
dup_task_struct+0x444/0x8c0 kernel/fork.c:1111
copy_process+0x5d1/0x3dc0 kernel/fork.c:2203
kernel_clone+0x226/0x8f0 kernel/fork.c:2780
__do_sys_clone kernel/fork.c:2923 [inline]
__se_sys_clone kernel/fork.c:2907 [inline]
__x64_sys_clone+0x258/0x2a0 kernel/fork.c:2907
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 4723 tgid 4723 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1093 [inline]
free_unref_page+0xd22/0xea0 mm/page_alloc.c:2588
mm_free_pgd kernel/fork.c:800 [inline]
__mmdrop+0xb9/0x3d0 kernel/fork.c:916
exit_mm+0x220/0x310 kernel/exit.c:566
do_exit+0x9b2/0x27f0 kernel/exit.c:864
do_group_exit+0x207/0x2c0 kernel/exit.c:1026
__do_sys_exit_group kernel/exit.c:1037 [inline]
__se_sys_exit_group kernel/exit.c:1035 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1035
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
Memory state around the buggy address:
ffffc90003137680: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90003137700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90003137780: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
^
ffffc90003137800: 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 f2 f2 f2
ffffc90003137880: f2 f2 00 f2 f2 f2 00 f2 f2 f2 00 f3 f3 f3 f3 f3
==================================================================
----------------
Code disassembly (best guess):
0: 2b 00 sub (%rax),%eax
2: 74 08 je 0xc
4: 4c 89 f7 mov %r14,%rdi
7: e8 4a 04 8a 00 call 0x8a0456
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