==================================================================
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+0x41c/0x4e0 net/core/filter.c:4305
Read of size 4 at addr ffffc900038e7a50 by task syz.2.2007/12625
CPU: 1 UID: 0 PID: 12625 Comm: syz.2.2007 Not tainted 6.10.0-syzkaller-12708-g2f8c4f506285 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline]
xdp_do_check_flushed+0x41c/0x4e0 net/core/filter.c:4305
__napi_poll.constprop.0+0xd1/0x550 net/core/dev.c:6774
napi_poll net/core/dev.c:6840 [inline]
net_rx_action+0xa92/0x1010 net/core/dev.c:6962
handle_softirqs+0x216/0x8f0 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:637 [inline]
irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:stack_trace_consume_entry+0xa4/0x170 kernel/stacktrace.c:93
Code: 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 98 00 00 00 8b 43 0c 85 c0 75 57 48 b8 00 00 00 00 00 fc ff df <48> 89 da 48 c1 ea 03 80 3c 02 00 0f 85 9a 00 00 00 8d 45 01 89 43
RSP: 0018:ffffc900038e6f10 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffffc900038e6ff8 RCX: ffffffff81340d9e
RDX: 0000000000000000 RSI: ffffffff81d00a44 RDI: ffffc900038e7004
RBP: 0000000000000006 R08: 0000000000000007 R09: 0000000000000000
R10: ffffffff81d00a44 R11: 0000000000000000 R12: ffffc900038e6f38
R13: ffffffff81762720 R14: ffffc900038e6ff8 R15: ffff8880273d8000
arch_stack_walk+0xe1/0x170 arch/x86/kernel/stacktrace.c:27
stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122
save_stack+0x162/0x1f0 mm/page_owner.c:156
__reset_page_owner+0x8d/0x400 mm/page_owner.c:297
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_folios+0x9e9/0x1390 mm/page_alloc.c:2656
folios_put_refs+0x560/0x760 mm/swap.c:1039
free_pages_and_swap_cache+0x36d/0x510 mm/swap_state.c:332
__tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136
tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:366 [inline]
tlb_flush_mmu+0xe9/0x590 mm/mmu_gather.c:373
zap_pte_range mm/memory.c:1697 [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+0x1c88/0x3c10 mm/memory.c:1807
unmap_single_vma+0x194/0x2b0 mm/memory.c:1853
unmap_vmas+0x22f/0x490 mm/memory.c:1897
exit_mmap+0x1b8/0xb20 mm/mmap.c:3412
__mmput+0x12a/0x480 kernel/fork.c:1345
mmput+0x62/0x70 kernel/fork.c:1367
exit_mm kernel/exit.c:571 [inline]
do_exit+0x9bf/0x2bb0 kernel/exit.c:869
do_group_exit+0xd3/0x2a0 kernel/exit.c:1031
get_signal+0x25fd/0x2770 kernel/signal.c:2917
arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:310
exit_to_user_mode_loop kernel/entry/common.c:111 [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+0x150/0x2a0 kernel/entry/common.c:218
do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8544177299
Code: Unable to access opcode bytes at 0x7f854417726f.
RSP: 002b:00007f8544e970f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007f8544306138 RCX: 00007f8544177299
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f8544306138
RBP: 00007f8544306130 R08: 00007f8544e976c0 R09: 00007f8544e976c0
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f854430613c
R13: 000000000000006e R14: 00007ffdf835f970 R15: 00007ffdf835fa58
The buggy address belongs to stack of task syz.2.2007/12625
and is located at offset 24 in frame:
exit_mmap+0x0/0xb20 mm/mmap.c:3232
This frame has 2 objects:
[32, 96) 'vmi'
[128, 256) 'tlb'
The buggy address belongs to the virtual mapping at
[ffffc900038e0000, ffffc900038e9000) created by:
kernel_clone+0xfd/0x980 kernel/fork.c:2781
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x2 pfn:0x4420f
memcg:ffff88802b2df082
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000002 0000000000000000 00000001ffffffff ffff88802b2df082
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 391580355637, free_ts 389019621312
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493
prep_new_page mm/page_alloc.c:1501 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3438
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4696
alloc_pages_mpol_noprof+0x275/0x610 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+0xa6a/0x1520 mm/vmalloc.c:3841
alloc_thread_stack_node kernel/fork.c:313 [inline]
dup_task_struct kernel/fork.c:1113 [inline]
copy_process+0x2f3b/0x8de0 kernel/fork.c:2204
kernel_clone+0xfd/0x980 kernel/fork.c:2781
kernel_thread+0xc0/0x100 kernel/fork.c:2843
create_kthread kernel/kthread.c:412 [inline]
kthreadd+0x4ef/0x7d0 kernel/kthread.c:765
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 12484 tgid 12481 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2608
vfree+0x181/0x7a0 mm/vmalloc.c:3364
translate_table+0x18d9/0x1f00 net/bridge/netfilter/ebtables.c:982
do_replace_finish+0x9a3/0x22c0 net/bridge/netfilter/ebtables.c:1032
do_replace+0x351/0x500 net/bridge/netfilter/ebtables.c:1153
do_ebt_set_ctl+0x470/0x580 net/bridge/netfilter/ebtables.c:2527
nf_setsockopt+0x8a/0xf0 net/netfilter/nf_sockopt.c:101
ip_setsockopt+0xcb/0xf0 net/ipv4/ip_sockglue.c:1424
udp_setsockopt+0x7d/0xd0 net/ipv4/udp.c:2806
do_sock_setsockopt+0x222/0x480 net/socket.c:2324
__sys_setsockopt+0x1a4/0x270 net/socket.c:2347
__do_sys_setsockopt net/socket.c:2356 [inline]
__se_sys_setsockopt net/socket.c:2353 [inline]
__x64_sys_setsockopt+0xbd/0x160 net/socket.c:2353
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffffc900038e7900: 00 f2 f2 f2 00 f2 f2 f2 00 00 f2 f2 00 00 00 00
ffffc900038e7980: 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00
>ffffc900038e7a00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00
^
ffffc900038e7a80: 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00
ffffc900038e7b00: 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
4: 48 89 f8 mov %rdi,%rax
7: 83 e0 07 and $0x7,%eax
a: 83 c0 03 add $0x3,%eax
d: 38 d0 cmp %dl,%al
f: 7c 08 jl 0x19
11: 84 d2 test %dl,%dl
13: 0f 85 98 00 00 00 jne 0xb1
19: 8b 43 0c mov 0xc(%rbx),%eax
1c: 85 c0 test %eax,%eax
1e: 75 57 jne 0x77
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 48 89 da mov %rbx,%rdx <-- trapping instruction
2d: 48 c1 ea 03 shr $0x3,%rdx
31: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
35: 0f 85 9a 00 00 00 jne 0xd5
3b: 8d 45 01 lea 0x1(%rbp),%eax
3e: 89 .byte 0x89
3f: 43 rex.XB