==================================================================
BUG: KASAN: stack-out-of-bounds in profile_pc+0x118/0x130 arch/x86/kernel/time.c:44
Read of size 8 at addr ffffc900039efc00 by task strace-static-x/5004
CPU: 0 PID: 5004 Comm: strace-static-x Not tainted 6.4.0-rc2-next-20230515-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
print_report mm/kasan/report.c:462 [inline]
kasan_report+0x11c/0x130 mm/kasan/report.c:571
profile_pc+0x118/0x130 arch/x86/kernel/time.c:44
profile_tick+0xcd/0x130 kernel/profile.c:339
tick_sched_timer+0xee/0x110 kernel/time/tick-sched.c:1481
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x1c0/0xa30 kernel/time/hrtimer.c:1749
hrtimer_interrupt+0x320/0x7b0 kernel/time/hrtimer.c:1811
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline]
__sysvec_apic_timer_interrupt+0x14a/0x430 arch/x86/kernel/apic/apic.c:1112
sysvec_apic_timer_interrupt+0x92/0xc0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:queued_read_lock_slowpath+0x134/0x2af kernel/locking/qrwlock.c:51
Code: 42 01 00 00 8b 45 00 84 c0 74 36 48 b8 00 00 00 00 00 fc ff df 49 89 ee 48 89 eb 49 c1 ee 03 83 e3 07 49 01 c6 83 c3 03 f3 90 <41> 0f b6 06 38 c3 7c 08 84 c0 0f 85 1b 01 00 00 8b 45 00 84 c0 75
RSP: 0018:ffffc900039efbf8 EFLAGS: 00000286
RAX: 00000000000002ff RBX: 0000000000000003 RCX: ffffffff8a146a8c
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8c40a080
RBP: ffffffff8c40a080 R08: 0000000000000001 R09: fffffbfff1881410
R10: ffffffff8c40a083 R11: 0000000000000001 R12: 1ffff9200073df80
R13: ffffffff8c40a084 R14: fffffbfff1881410 R15: 0000000000000000
do_wait+0x283/0xc30 kernel/exit.c:1604
kernel_wait4+0x150/0x260 kernel/exit.c:1777
__do_sys_wait4+0x13f/0x150 kernel/exit.c:1805
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x4d6ad6
Code: 00 00 00 90 31 c9 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 49 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 11 b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 5a c3 90 48 83 ec 28 89 54 24 14 48 89 74 24
RSP: 002b:00007fff7bcd2af8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000004d6ad6
RDX: 0000000040000001 RSI: 00007fff7bcd2b1c RDI: 00000000ffffffff
RBP: 000000000000162b R08: 0000000000000000 R09: 0000000001063a10
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001069400
R13: 00007fff7bcd2b1c R14: 00000000010648b0 R15: 000000000063f160
The buggy address belongs to stack of task strace-static-x/5004
and is located at offset 0 in frame:
queued_read_lock_slowpath+0x0/0x2af arch/x86/include/asm/paravirt.h:586
This frame has 1 object:
[32, 36) 'val'
The buggy address belongs to the virtual mapping at
[ffffc900039e8000, ffffc900039f1000) created by:
kernel_clone+0xeb/0x890 kernel/fork.c:2914
The buggy address belongs to the physical page:
page:ffffea0001cce500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73394
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 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 5002, tgid 5002 (sshd), ts 75956775167, free_ts 75907843225
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731
prep_new_page mm/page_alloc.c:1738 [inline]
get_page_from_freelist+0xf67/0x2a80 mm/page_alloc.c:3539
__alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4805
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279
vm_area_alloc_pages mm/vmalloc.c:3009 [inline]
__vmalloc_area_node mm/vmalloc.c:3085 [inline]
__vmalloc_node_range+0xb73/0x1490 mm/vmalloc.c:3257
alloc_thread_stack_node kernel/fork.c:309 [inline]
dup_task_struct kernel/fork.c:1112 [inline]
copy_process+0x13bb/0x7600 kernel/fork.c:2329
kernel_clone+0xeb/0x890 kernel/fork.c:2914
__do_sys_clone+0xba/0x100 kernel/fork.c:3057
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1302 [inline]
free_unref_page_prepare+0x4dd/0xb90 mm/page_alloc.c:2600
free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2741
release_pages+0xcd8/0x1380 mm/swap.c:1042
tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97
tlb_flush_mmu_free mm/mmu_gather.c:292 [inline]
tlb_flush_mmu mm/mmu_gather.c:299 [inline]
tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391
exit_mmap+0x2b2/0x930 mm/mmap.c:3146
__mmput+0x128/0x4c0 kernel/fork.c:1347
mmput+0x60/0x70 kernel/fork.c:1369
exit_mm kernel/exit.c:564 [inline]
do_exit+0x9d7/0x29f0 kernel/exit.c:858
do_group_exit+0xd4/0x2a0 kernel/exit.c:1021
__do_sys_exit_group kernel/exit.c:1032 [inline]
__se_sys_exit_group kernel/exit.c:1030 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Memory state around the buggy address:
ffffc900039efb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900039efb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900039efc00: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00
^
ffffc900039efc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
ffffc900039efd00: f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 f3 f3
==================================================================
----------------
Code disassembly (best guess):
0: 42 01 00 rex.X add %eax,(%rax)
3: 00 8b 45 00 84 c0 add %cl,-0x3f7bffbb(%rbx)
9: 74 36 je 0x41
b: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
12: fc ff df
15: 49 89 ee mov %rbp,%r14
18: 48 89 eb mov %rbp,%rbx
1b: 49 c1 ee 03 shr $0x3,%r14
1f: 83 e3 07 and $0x7,%ebx
22: 49 01 c6 add %rax,%r14
25: 83 c3 03 add $0x3,%ebx
28: f3 90 pause
* 2a: 41 0f b6 06 movzbl (%r14),%eax <-- trapping instruction
2e: 38 c3 cmp %al,%bl
30: 7c 08 jl 0x3a
32: 84 c0 test %al,%al
34: 0f 85 1b 01 00 00 jne 0x155
3a: 8b 45 00 mov 0x0(%rbp),%eax
3d: 84 c0 test %al,%al
3f: 75 .byte 0x75