==================================================================
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:4298
Read of size 4 at addr ffffc900036d7a40 by task syz.2.83/5575
CPU: 2 UID: 0 PID: 5575 Comm: syz.2.83 Not tainted 6.10.0-syzkaller-12097-ge9680017b2dc #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:4298
__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:console_flush_all+0xa19/0xd70 kernel/printk/printk.c:3055
Code: e8 3c 57 26 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 3a 0c 1f 00 48 85 db 0f 85 8b 01 00 00 e8 fc 10 1f 00 fb 48 8b 04 24 <4c> 89 fa 83 e2 07 0f b6 00 38 d0 7f 08 84 c0 0f 85 a9 02 00 00 41
RSP: 0018:ffffc900036d70d0 EFLAGS: 00000287
RAX: fffff520006dae41 RBX: 0000000000000000 RCX: ffffc90007de1000
RDX: 0000000000040000 RSI: ffffffff816c0c24 RDI: 0000000000000007
RBP: dffffc0000000000 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000200
R13: ffffffff8e7cde98 R14: ffffffff8e7cde40 R15: ffffc900036d7208
console_unlock+0xae/0x290 kernel/printk/printk.c:3118
vprintk_emit kernel/printk/printk.c:2348 [inline]
vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2303
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2373
__nla_validate_parse+0x757/0x2b10 lib/nlattr.c:647
__nla_parse+0x40/0x60 lib/nlattr.c:732
__nlmsg_parse include/net/netlink.h:761 [inline]
genl_family_rcv_msg_attrs_parse.constprop.0+0x19e/0x290 net/netlink/genetlink.c:945
genl_family_rcv_msg_doit+0xbf/0x2f0 net/netlink/genetlink.c:1093
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
netlink_unicast+0x544/0x830 net/netlink/af_netlink.c:1357
netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9b4/0xb50 net/socket.c:2597
___sys_sendmsg+0x135/0x1e0 net/socket.c:2651
__sys_sendmsg+0x117/0x1f0 net/socket.c:2680
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7f0f579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f56c657c EFLAGS: 00000292 ORIG_RAX: 0000000000000172
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020000040
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
The buggy address belongs to stack of task syz.2.83/5575
and is located at offset 8 in frame:
netlink_sendmsg+0x0/0xd70 net/netlink/af_netlink.c:1329
This frame has 1 object:
[32, 64) 'scm'
The buggy address belongs to the virtual mapping at
[ffffc900036d0000, ffffc900036d9000) 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:0xffff888011cf4178 pfn:0x11cf4
memcg:ffff888000b5d402
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff888011cf4178 0000000000000000 00000001ffffffff ffff888000b5d402
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 5465, tgid 5465 (syz.0.53), ts 71529651570, free_ts 70010340420
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+0x29f5/0x6f50 kernel/fork.c:2204
kernel_clone+0xfd/0x980 kernel/fork.c:2781
__do_sys_clone3+0x1f5/0x270 kernel/fork.c:3085
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
do_int80_emulation+0x104/0x200 arch/x86/entry/common.c:253
asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:626
page last free pid 10 tgid 10 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
delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3285
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffffc900036d7900: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
ffffc900036d7980: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900036d7a00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 f3
^
ffffc900036d7a80: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900036d7b00: 00 f1 f1 f1 f1 f1 f1 00 00 00 00 04 f3 f3 f3 f3
==================================================================
----------------
Code disassembly (best guess):
0: e8 3c 57 26 00 call 0x265741
5: 9c pushf
6: 5b pop %rbx
7: 81 e3 00 02 00 00 and $0x200,%ebx
d: 31 ff xor %edi,%edi
f: 48 89 de mov %rbx,%rsi
12: e8 3a 0c 1f 00 call 0x1f0c51
17: 48 85 db test %rbx,%rbx
1a: 0f 85 8b 01 00 00 jne 0x1ab
20: e8 fc 10 1f 00 call 0x1f1121
25: fb sti
26: 48 8b 04 24 mov (%rsp),%rax
* 2a: 4c 89 fa mov %r15,%rdx <-- trapping instruction
2d: 83 e2 07 and $0x7,%edx
30: 0f b6 00 movzbl (%rax),%eax
33: 38 d0 cmp %dl,%al
35: 7f 08 jg 0x3f
37: 84 c0 test %al,%al
39: 0f 85 a9 02 00 00 jne 0x2e8
3f: 41 rex.B