==================================================================
BUG: KASAN: stack-out-of-bounds in __cpa_flush_tlb+0x46/0x270 arch/x86/mm/pat/set_memory.c:407
Read of size 8 at addr ffffc90004f1f920 by task syz.0.1981/12678
CPU: 1 UID: 0 PID: 12678 Comm: syz.0.1981 Not tainted 6.16.0-rc4-next-20250702-syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:408 [inline]
print_report+0xd2/0x2b0 mm/kasan/report.c:521
kasan_report+0x118/0x150 mm/kasan/report.c:634
__cpa_flush_tlb+0x46/0x270 arch/x86/mm/pat/set_memory.c:407
csd_do_func kernel/smp.c:134 [inline]
__flush_smp_call_function_queue+0x370/0xaa0 kernel/smp.c:540
__sysvec_call_function_single+0xa8/0x3d0 arch/x86/kernel/smp.c:271
instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline]
sysvec_call_function_single+0x9e/0xc0 arch/x86/kernel/smp.c:266
asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709
RIP: 0010:console_flush_all+0x7f7/0xc40 kernel/printk/printk.c:3227
Code: 48 21 c3 0f 85 e9 01 00 00 e8 b5 36 1f 00 48 8b 5c 24 20 4d 85 f6 75 07 e8 a6 36 1f 00 eb 06 e8 9f 36 1f 00 fb 48 8b 44 24 28 <42> 80 3c 20 00 74 08 48 89 df e8 0a 4a 83 00 48 8b 1b 48 8b 44 24
RSP: 0000:ffffc90005677120 EFLAGS: 00000283
RAX: 1ffffffff1d36b7b RBX: ffffffff8e9b5bd8 RCX: 0000000000080000
RDX: ffffc9000eb40000 RSI: 0000000000001cf0 RDI: 0000000000001cf1
RBP: ffffc90005677270 R08: ffffffff8fa17c37 R09: 1ffffffff1f42f86
R10: dffffc0000000000 R11: fffffbfff1f42f87 R12: dffffc0000000000
R13: 0000000000000001 R14: 0000000000000200 R15: ffffffff8e9b5b80
__console_flush_and_unlock kernel/printk/printk.c:3285 [inline]
console_unlock+0xc4/0x270 kernel/printk/printk.c:3325
vprintk_emit+0x5b7/0x7a0 kernel/printk/printk.c:2450
_printk+0xcf/0x120 kernel/printk/printk.c:2475
netdev_info+0x10a/0x160 net/core/dev.c:12605
netif_set_allmulti+0x1b8/0x380 net/core/dev.c:9376
dev_set_allmulti+0x12b/0x260 net/core/dev_api.c:313
vif_delete+0x4d6/0x910 net/ipv4/ipmr.c:704
mroute_clean_tables+0x24b/0xaa0 net/ipv4/ipmr.c:1310
mrtsock_destruct+0x1c3/0x240 net/ipv4/ipmr.c:1362
ip_ra_control+0x492/0x530 net/ipv4/ip_sockglue.c:374
ip_mroute_setsockopt+0x90c/0xf60 net/ipv4/ipmr.c:1436
do_ip_setsockopt+0xf11/0x2d00 net/ipv4/ip_sockglue.c:948
ip_setsockopt+0x66/0x110 net/ipv4/ip_sockglue.c:1417
do_sock_setsockopt+0x25a/0x3e0 net/socket.c:2344
__sys_setsockopt net/socket.c:2369 [inline]
__do_sys_setsockopt net/socket.c:2375 [inline]
__se_sys_setsockopt net/socket.c:2372 [inline]
__x64_sys_setsockopt+0x18b/0x220 net/socket.c:2372
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f54d738e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f54d8156038 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f54d75b6240 RCX: 00007f54d738e929
RDX: 00000000000000c9 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007f54d7410b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f54d75b6240 R15: 00007ffe7b9d5ec8
The buggy address belongs to the virtual mapping at
[ffffc90004f18000, ffffc90004f21000) created by:
copy_process+0x54b/0x3c00 kernel/fork.c:1998
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804ee32fc0 pfn:0x4ee32
memcg:ffff88802e9f4402
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff88804ee32fc0 0000000000000000 00000001ffffffff ffff88802e9f4402
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_ZERO|__GFP_NOWARN), pid 2, tgid 2 (kthreadd), ts 410268962104, free_ts 410151951468
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1848
prep_new_page mm/page_alloc.c:1856 [inline]
get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3855
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5145
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419
alloc_frozen_pages_noprof mm/mempolicy.c:2490 [inline]
alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2510
vm_area_alloc_pages mm/vmalloc.c:3642 [inline]
__vmalloc_area_node mm/vmalloc.c:3720 [inline]
__vmalloc_node_range_noprof+0x97d/0x12f0 mm/vmalloc.c:3893
__vmalloc_node_noprof+0xc2/0x110 mm/vmalloc.c:3956
alloc_thread_stack_node kernel/fork.c:310 [inline]
dup_task_struct+0x3e7/0x860 kernel/fork.c:876
copy_process+0x54b/0x3c00 kernel/fork.c:1998
kernel_clone+0x21e/0x870 kernel/fork.c:2598
kernel_thread+0x10c/0x160 kernel/fork.c:2660
create_kthread kernel/kthread.c:486 [inline]
kthreadd+0x575/0x770 kernel/kthread.c:846
ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
page last free pid 12555 tgid 12555 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1392 [inline]
__free_frozen_pages+0xb80/0xd80 mm/page_alloc.c:2892
pagetable_free include/linux/mm.h:2896 [inline]
pagetable_dtor_free include/linux/mm.h:2994 [inline]
__tlb_remove_table+0x2d2/0x3b0 include/asm-generic/tlb.h:220
__tlb_remove_table_free mm/mmu_gather.c:227 [inline]
tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290
rcu_do_batch kernel/rcu/tree.c:2582 [inline]
rcu_core+0xca5/0x1710 kernel/rcu/tree.c:2838
handle_softirqs+0x286/0x870 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
Memory state around the buggy address:
ffffc90004f1f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90004f1f880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90004f1f900: 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 00 f3 f3
^
ffffc90004f1f980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90004f1fa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 48 21 c3 and %rax,%rbx
3: 0f 85 e9 01 00 00 jne 0x1f2
9: e8 b5 36 1f 00 call 0x1f36c3
e: 48 8b 5c 24 20 mov 0x20(%rsp),%rbx
13: 4d 85 f6 test %r14,%r14
16: 75 07 jne 0x1f
18: e8 a6 36 1f 00 call 0x1f36c3
1d: eb 06 jmp 0x25
1f: e8 9f 36 1f 00 call 0x1f36c3
24: fb sti
25: 48 8b 44 24 28 mov 0x28(%rsp),%rax
* 2a: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 48 89 df mov %rbx,%rdi
34: e8 0a 4a 83 00 call 0x834a43
39: 48 8b 1b mov (%rbx),%rbx
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 44 rex.R
3f: 24 .byte 0x24