==================================================================
BUG: KASAN: out-of-bounds in __cpa_flush_tlb+0x46/0x270 arch/x86/mm/pat/set_memory.c:407
Read of size 8 at addr ffffc900036f7920 by task syz.4.71/6339
CPU: 1 UID: 0 PID: 6339 Comm: syz.4.71 Not tainted 6.16.0-rc4-next-20250630-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:finish_task_switch+0x26b/0x950 kernel/sched/core.c:5181
Code: 0f 84 3c 01 00 00 48 85 db 0f 85 63 01 00 00 e9 27 05 00 00 4c 8b 75 d0 4c 89 e7 e8 2f db e0 09 e8 3a 0e 36 00 fb 4c 8b 65 c0 <49> 8d bc 24 18 16 00 00 48 89 f8 48 c1 e8 03 42 0f b6 04 28 84 c0
RSP: 0018:ffffc90004acf2d8 EFLAGS: 00000286
RAX: 38e5086a21590c00 RBX: 0000000000000000 RCX: 38e5086a21590c00
RDX: 0000000000000006 RSI: ffffffff8d992cd0 RDI: ffffffff8be31d00
RBP: ffffc90004acf330 R08: ffffffff8fa17437 R09: 1ffffffff1f42e86
R10: dffffc0000000000 R11: fffffbfff1f42e87 R12: ffff88802ca8bc00
R13: dffffc0000000000 R14: ffff88801ceada00 R15: ffff8880b873ab18
context_switch kernel/sched/core.c:5316 [inline]
__schedule+0x16fd/0x4d00 kernel/sched/core.c:6696
preempt_schedule_irq+0xb5/0x150 kernel/sched/core.c:7019
irqentry_exit+0x6f/0x90 kernel/entry/common.c:307
asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:707
RIP: 0010:check_kcov_mode kernel/kcov.c:194 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x37/0x70 kernel/kcov.c:217
Code: 08 30 a0 92 65 8b 15 88 64 e0 10 81 e2 00 01 ff 00 74 11 81 fa 00 01 00 00 75 35 83 b9 3c 16 00 00 00 74 2c 8b 91 18 16 00 00 <83> fa 02 75 21 48 8b 91 20 16 00 00 48 8b 32 48 8d 7e 01 8b 89 1c
RSP: 0018:ffffc90004acf6d8 EFLAGS: 00000246
RAX: ffffffff8a1c5a85 RBX: 0000000000000000 RCX: ffff88802ca8bc00
RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffff8880332bc028
RBP: ffffc90004acf870 R08: ffffc90004acf79f R09: 0000000000000000
R10: ffffc90004acf780 R11: fffff52000959ef4 R12: ffff8880332bc000
R13: 1ffff92000959eec R14: ffff8880332bc034 R15: 00000000ffffffff
get_pid include/linux/pid.h:89 [inline]
scm_set_cred include/net/scm.h:72 [inline]
__unix_dgram_recvmsg+0x7e5/0xde0 net/unix/af_unix.c:2562
sock_recvmsg_nosec+0x183/0x1c0 net/socket.c:1065
____sys_recvmsg+0x3aa/0x460 net/socket.c:2832
___sys_recvmsg+0x1b5/0x510 net/socket.c:2876
do_recvmmsg+0x307/0x770 net/socket.c:2971
__sys_recvmmsg net/socket.c:3045 [inline]
__do_sys_recvmmsg net/socket.c:3068 [inline]
__se_sys_recvmmsg net/socket.c:3061 [inline]
__x64_sys_recvmmsg+0x190/0x240 net/socket.c:3061
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:0x7f221658e929
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:00007f221735b038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f22167b6080 RCX: 00007f221658e929
RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000006
RBP: 00007f2216610b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f22167b6080 R15: 00007fffac6c3818
The buggy address belongs to the virtual mapping at
[ffffc900036f0000, ffffc900036f9000) 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:0xffff8880746c3dc0 pfn:0x746c3
memcg:ffff8880246f5682
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff8880746c3dc0 0000000000000000 00000001ffffffff ffff8880246f5682
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 6325, tgid 6325 (syz.4.68), ts 143661785948, free_ts 142296907765
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
__do_sys_clone3 kernel/fork.c:2902 [inline]
__se_sys_clone3+0x256/0x2d0 kernel/fork.c:2881
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
page last free pid 6040 tgid 6040 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
discard_slab mm/slub.c:2753 [inline]
__put_partials+0x156/0x1a0 mm/slub.c:3218
put_cpu_partial+0x17c/0x250 mm/slub.c:3293
__slab_free+0x2d5/0x3c0 mm/slub.c:4550
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4180 [inline]
slab_alloc_node mm/slub.c:4229 [inline]
kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4236
getname_flags+0xb8/0x540 fs/namei.c:146
getname include/linux/fs.h:2909 [inline]
getname_maybe_null include/linux/fs.h:2916 [inline]
vfs_fstatat+0x43/0x170 fs/stat.c:370
__do_sys_newfstatat fs/stat.c:542 [inline]
__se_sys_newfstatat fs/stat.c:536 [inline]
__x64_sys_newfstatat+0x116/0x190 fs/stat.c:536
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
Memory state around the buggy address:
ffffc900036f7800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900036f7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900036f7900: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
^
ffffc900036f7980: 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00
ffffc900036f7a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 0f 84 3c 01 00 00 je 0x142
6: 48 85 db test %rbx,%rbx
9: 0f 85 63 01 00 00 jne 0x172
f: e9 27 05 00 00 jmp 0x53b
14: 4c 8b 75 d0 mov -0x30(%rbp),%r14
18: 4c 89 e7 mov %r12,%rdi
1b: e8 2f db e0 09 call 0x9e0db4f
20: e8 3a 0e 36 00 call 0x360e5f
25: fb sti
26: 4c 8b 65 c0 mov -0x40(%rbp),%r12
* 2a: 49 8d bc 24 18 16 00 lea 0x1618(%r12),%rdi <-- trapping instruction
31: 00
32: 48 89 f8 mov %rdi,%rax
35: 48 c1 e8 03 shr $0x3,%rax
39: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax
3e: 84 c0 test %al,%al