================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0x118/0x130 arch/x86/kernel/time.c:44 Read of size 8 at addr ffffc90003d1fc40 by task syz-executor423/5076 CPU: 1 PID: 5076 Comm: syz-executor423 Not tainted 6.2.0-rc3-next-20230109-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:1485 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x1c6/0xcf0 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/0x660 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:ffffc90003d1fc38 EFLAGS: 00000286 RAX: 00000000000002ff RBX: 0000000000000003 RCX: ffffffff8a070cbc RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8c40a080 RBP: ffffffff8c40a080 R08: 0000000000000001 R09: ffffffff8c40a083 R10: fffffbfff1881410 R11: 0000000000000000 R12: 1ffff920007a3f88 R13: ffffffff8c40a084 R14: fffffbfff1881410 R15: ffff88807e228548 ptrace_stop.part.0+0x306/0x8e0 kernel/signal.c:2282 ptrace_stop kernel/signal.c:2233 [inline] ptrace_signal kernel/signal.c:2571 [inline] get_signal+0x122c/0x24f0 kernel/signal.c:2747 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe66a63b9f6 Code: 0f 1f 40 00 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:00007ffeabab74a8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d RAX: 00000000000014d1 RBX: 00000000000f4240 RCX: 00007fe66a63b9f6 RDX: 0000000040000001 RSI: 00007ffeabab74bc RDI: 00000000ffffffff RBP: 00000000000014d1 R08: 0000000000000036 R09: 00007ffeabb57080 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000d44a R13: 00007ffeabab74bc R14: 00007ffeabab74d0 R15: 00007ffeabab74c0 The buggy address belongs to stack of task syz-executor423/5076 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 [ffffc90003d18000, ffffc90003d21000) created by: kernel_clone+0xeb/0x9a0 kernel/fork.c:2684 The buggy address belongs to the physical page: page:ffffea00008e7b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x239ed 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 5072, tgid 5072 (syz-executor423), ts 51947658790, free_ts 42823466771 prep_new_page mm/page_alloc.c:2546 [inline] get_page_from_freelist+0x119e/0x2a80 mm/page_alloc.c:4298 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5564 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2272 vm_area_alloc_pages mm/vmalloc.c:3008 [inline] __vmalloc_area_node mm/vmalloc.c:3076 [inline] __vmalloc_node_range+0xb30/0x12e0 mm/vmalloc.c:3246 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:984 [inline] copy_process+0x1341/0x7740 kernel/fork.c:2100 kernel_clone+0xeb/0x9a0 kernel/fork.c:2684 __do_sys_clone+0xba/0x100 kernel/fork.c:2825 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:1448 [inline] free_pcp_prepare+0x4d0/0x9e0 mm/page_alloc.c:1498 free_unref_page_prepare mm/page_alloc.c:3384 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3479 __folio_put_small mm/swap.c:106 [inline] __folio_put+0xc5/0x140 mm/swap.c:129 folio_put include/linux/mm.h:1277 [inline] put_page include/linux/mm.h:1346 [inline] anon_pipe_buf_release+0x3fb/0x4c0 fs/pipe.c:138 pipe_buf_release include/linux/pipe_fs_i.h:183 [inline] pipe_read+0x614/0x1110 fs/pipe.c:324 call_read_iter include/linux/fs.h:2185 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7fa/0x930 fs/read_write.c:470 ksys_read+0x1ec/0x250 fs/read_write.c:613 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: ffffc90003d1fb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90003d1fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90003d1fc00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f3 f3 f3 ^ ffffc90003d1fc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90003d1fd00: 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