==================================================================
BUG: KASAN: stack-out-of-bounds in profile_pc+0x118/0x130 arch/x86/kernel/time.c:44
Read of size 8 at addr ffffc90003cdfe50 by task strace-static-x/5069
CPU: 0 PID: 5069 Comm: strace-static-x Not tainted 6.1.0-next-20221220-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:306 [inline]
print_report+0x15e/0x45d mm/kasan/report.c:417
kasan_report+0xc0/0xf0 mm/kasan/report.c:517
profile_pc+0x118/0x130 arch/x86/kernel/time.c:44
profile_tick+0x108/0x180 kernel/profile.c:339
tick_sched_timer+0xf2/0x120 kernel/time/tick-sched.c:1480
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x1c6/0xcc0 kernel/time/hrtimer.c:1749
hrtimer_interrupt+0x320/0x790 kernel/time/hrtimer.c:1811
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1096 [inline]
__sysvec_apic_timer_interrupt+0x180/0x640 arch/x86/kernel/apic/apic.c:1113
sysvec_apic_timer_interrupt+0x92/0xc0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
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:ffffc90003cdfe48 EFLAGS: 00000286
RAX: 00000000000002ff RBX: 0000000000000003 RCX: ffffffff8a0b01cc
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8c40a080
RBP: ffffffff8c40a080 R08: 0000000000000001 R09: ffffffff8c40a083
R10: fffffbfff1881410 R11: 0000000000000000 R12: 1ffff9200079bfca
R13: ffffffff8c40a084 R14: fffffbfff1881410 R15: 0000000000000000
ptrace_check_attach+0x1c/0x3f0 kernel/ptrace.c:260
__do_sys_ptrace kernel/ptrace.c:1291 [inline]
__se_sys_ptrace kernel/ptrace.c:1269 [inline]
__x64_sys_ptrace+0x154/0x2a0 kernel/ptrace.c:1269
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:0x4e987a
Code: 70 41 83 f8 03 c7 44 24 10 08 00 00 00 48 89 44 24 18 48 8d 44 24 30 8b 70 08 4c 0f 43 d1 48 89 44 24 20 b8 65 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 3e 48 85 c0 78 06 41 83 f8 02 76 1b 48 8b 54
RSP: 002b:00007fffec93b900 EFLAGS: 00000206 ORIG_RAX: 0000000000000065
RAX: ffffffffffffffda RBX: 000000000184b368 RCX: 00000000004e987a
RDX: 0000000000000000 RSI: 00000000000016a7 RDI: 0000000000000018
RBP: 0000000000000018 R08: 0000000000000017 R09: 0000000000000012
R10: 0000000000000000 R11: 0000000000000206 R12: 000000000184d760
R13: 0000000000000000 R14: 000000000184cce0 R15: 000000000063f160
The buggy address belongs to stack of task strace-static-x/5069
and is located at offset 0 in frame:
queued_read_lock_slowpath+0x0/0x2af arch/x86/include/asm/paravirt.h:591
This frame has 1 object:
[32, 36) 'val'
The buggy address belongs to the virtual mapping at
[ffffc90003cd8000, ffffc90003ce1000) created by:
kernel_clone+0xeb/0xa40 kernel/fork.c:2681
The buggy address belongs to the physical page:
page:ffffea0001e23ec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x788fb
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
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 5053, tgid 5053 (dhcpcd-run-hook), ts 50972503799, free_ts 50816570056
prep_new_page mm/page_alloc.c:2531 [inline]
get_page_from_freelist+0x119e/0x2a80 mm/page_alloc.c:4283
__alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2282
vm_area_alloc_pages mm/vmalloc.c:2989 [inline]
__vmalloc_area_node mm/vmalloc.c:3059 [inline]
__vmalloc_node_range+0x96d/0x13c0 mm/vmalloc.c:3229
alloc_thread_stack_node kernel/fork.c:311 [inline]
dup_task_struct kernel/fork.c:987 [inline]
copy_process+0x12d2/0x75c0 kernel/fork.c:2097
kernel_clone+0xeb/0xa40 kernel/fork.c:2681
__do_sys_clone+0xba/0x100 kernel/fork.c:2822
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:1446 [inline]
free_pcp_prepare+0x4d0/0x9e0 mm/page_alloc.c:1496
free_unref_page_prepare mm/page_alloc.c:3369 [inline]
free_unref_page+0x1d/0x490 mm/page_alloc.c:3464
__vunmap+0x85d/0xd30 mm/vmalloc.c:2727
free_work+0x5c/0x80 mm/vmalloc.c:100
process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289
worker_thread+0x669/0x1090 kernel/workqueue.c:2436
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Memory state around the buggy address:
ffffc90003cdfd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90003cdfd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90003cdfe00: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f3
^
ffffc90003cdfe80: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90003cdff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
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