================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0x181/0x190 arch/x86/kernel/time.c:44 Read of size 8 at addr ffffc900035bfba0 by task strace-static-x/5057 CPU: 0 PID: 5057 Comm: strace-static-x Not tainted 6.8.0-rc1-next-20240125-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 profile_pc+0x181/0x190 arch/x86/kernel/time.c:44 profile_tick+0xcd/0x130 kernel/profile.c:339 tick_nohz_highres_handler+0xed/0x120 kernel/time/tick-sched.c:1519 __run_hrtimer kernel/time/hrtimer.c:1689 [inline] __hrtimer_run_queues+0x657/0xc20 kernel/time/hrtimer.c:1753 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1815 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x10f/0x410 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:queued_read_lock_slowpath+0x131/0x2b1 kernel/locking/qrwlock.c:51 Code: 85 45 01 00 00 8b 03 84 c0 74 36 48 b8 00 00 00 00 00 fc ff df 49 89 de 48 89 dd 49 c1 ee 03 83 e5 07 49 01 c6 83 c5 03 f3 90 <41> 0f b6 06 40 38 c5 7c 08 84 c0 0f 85 1f 01 00 00 8b 03 84 c0 75 RSP: 0018:ffffc900035bfb98 EFLAGS: 00000286 RAX: 00000000000002ff RBX: ffffffff8d20a080 RCX: ffffffff8abdde2b RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8d20a080 RBP: 0000000000000003 R08: 0000000000000001 R09: fffffbfff1a41410 R10: ffffffff8d20a083 R11: 0000000000000000 R12: 1ffff920006b7f74 R13: ffffffff8d20a084 R14: fffffbfff1a41410 R15: ffffffff8151e8d9 __do_wait+0x105/0x890 kernel/exit.c:1580 do_wait+0x219/0x540 kernel/exit.c:1624 kernel_wait4+0x16c/0x280 kernel/exit.c:1783 __do_sys_wait4+0x15f/0x170 kernel/exit.c:1811 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 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:00007fffeb17d058 EFLAGS: 00000246 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000004d6ad6 RDX: 0000000040000001 RSI: 00007fffeb17d07c RDI: 00000000ffffffff RBP: 00000000000015ff R08: 0000000000000000 R09: 00000000000001ff R10: 0000000000000000 R11: 0000000000000246 R12: 00000000024a13f0 R13: 00007fffeb17d07c R14: 000000000249d8b0 R15: 000000000063f160 The buggy address belongs to stack of task strace-static-x/5057 and is located at offset 0 in frame: queued_read_lock_slowpath+0x0/0x2b1 arch/x86/include/asm/paravirt.h:584 This frame has 1 object: [32, 36) 'val' The buggy address belongs to the virtual mapping at [ffffc900035b8000, ffffc900035c1000) created by: kernel_clone+0xfd/0x940 kernel/fork.c:2903 The buggy address belongs to the physical page: page:ffffea0001f19380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c64e flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000000 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 5052, tgid 5052 (sshd), ts 67433461163, free_ts 67426892618 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa19/0x3740 mm/page_alloc.c:3347 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4603 alloc_pages_mpol+0x275/0x610 mm/mempolicy.c:2232 vm_area_alloc_pages mm/vmalloc.c:3454 [inline] __vmalloc_area_node mm/vmalloc.c:3530 [inline] __vmalloc_node_range+0xa6b/0x1540 mm/vmalloc.c:3711 alloc_thread_stack_node kernel/fork.c:307 [inline] dup_task_struct kernel/fork.c:1112 [inline] copy_process+0x1502/0x96e0 kernel/fork.c:2328 kernel_clone+0xfd/0x940 kernel/fork.c:2903 __do_sys_clone+0xba/0x100 kernel/fork.c:3046 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 page last free pid 5053 tgid 5053 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2382 free_unref_page_list+0xe6/0xb50 mm/page_alloc.c:2568 release_pages+0x32a/0x14f0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu mm/mmu_gather.c:300 [inline] tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392 exit_mmap+0x40e/0xbe0 mm/mmap.c:3273 __mmput+0x12a/0x4d0 kernel/fork.c:1343 mmput+0x62/0x70 kernel/fork.c:1365 exit_mm kernel/exit.c:569 [inline] do_exit+0x999/0x2ac0 kernel/exit.c:858 do_group_exit+0xd3/0x2a0 kernel/exit.c:1020 __do_sys_exit_group kernel/exit.c:1031 [inline] __se_sys_exit_group kernel/exit.c:1029 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1029 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Memory state around the buggy address: ffffc900035bfa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900035bfb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900035bfb80: 00 00 00 00 f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 ^ ffffc900035bfc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900035bfc80: 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 85 45 01 test %eax,0x1(%rbp) 3: 00 00 add %al,(%rax) 5: 8b 03 mov (%rbx),%eax 7: 84 c0 test %al,%al 9: 74 36 je 0x41 b: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 12: fc ff df 15: 49 89 de mov %rbx,%r14 18: 48 89 dd mov %rbx,%rbp 1b: 49 c1 ee 03 shr $0x3,%r14 1f: 83 e5 07 and $0x7,%ebp 22: 49 01 c6 add %rax,%r14 25: 83 c5 03 add $0x3,%ebp 28: f3 90 pause * 2a: 41 0f b6 06 movzbl (%r14),%eax <-- trapping instruction 2e: 40 38 c5 cmp %al,%bpl 31: 7c 08 jl 0x3b 33: 84 c0 test %al,%al 35: 0f 85 1f 01 00 00 jne 0x15a 3b: 8b 03 mov (%rbx),%eax 3d: 84 c0 test %al,%al 3f: 75 .byte 0x75