================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0x179/0x190 arch/x86/kernel/time.c:44 Read of size 8 at addr ffffc900033cfbb0 by task strace-static-x/5053 CPU: 0 PID: 5053 Comm: strace-static-x Not tainted 6.6.0-syzkaller-14142-g90b0c2b2edd1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 profile_pc+0x179/0x190 arch/x86/kernel/time.c:44 profile_tick+0xcd/0x130 kernel/profile.c:339 tick_nohz_highres_handler+0xe9/0x110 kernel/time/tick-sched.c:1516 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x647/0xc10 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x105/0x3f0 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:queued_read_lock_slowpath+0x13a/0x2ab kernel/locking/qrwlock.c:51 Code: 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 19 01 00 00 8b 03 84 c0 75 e7 48 c7 c0 a8 34 e1 8c 48 RSP: 0018:ffffc900033cfba8 EFLAGS: 00000206 RAX: 0000000000000000 RBX: ffffffff8cc0a080 RCX: ffffffff8a83bb0b RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8cc0a080 RBP: 0000000000000003 R08: 0000000000000001 R09: fffffbfff1981410 R10: ffffffff8cc0a083 R11: 0000000000000000 R12: 1ffff92000679f76 R13: ffffffff8cc0a084 R14: fffffbfff1981410 R15: ffffffff814edce2 __do_wait+0x105/0x890 kernel/exit.c:1585 do_wait+0x212/0x520 kernel/exit.c:1629 kernel_wait4+0x16d/0x280 kernel/exit.c:1788 __do_sys_wait4+0x15b/0x170 kernel/exit.c:1816 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b 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:00007ffce07573a8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000004d6ad6 RDX: 0000000040000001 RSI: 00007ffce07573cc RDI: 00000000ffffffff RBP: 00000000000013c9 R08: 0000000000000000 R09: 00000000000003c9 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000258f400 R13: 00007ffce07573cc R14: 000000000258a760 R15: 000000000063f160 The buggy address belongs to stack of task strace-static-x/5053 and is located at offset 0 in frame: queued_read_lock_slowpath+0x0/0x2ab arch/x86/include/asm/paravirt.h:586 This frame has 1 object: [32, 36) 'val' The buggy address belongs to the virtual mapping at [ffffc900033c8000, ffffc900033d1000) created by: kernel_clone+0xfd/0x920 kernel/fork.c:2907 The buggy address belongs to the physical page: page:ffffea0001fa4040 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e901 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 5051, tgid 5051 (sshd), ts 75501957505, free_ts 75498325297 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x8f3/0x1bf0 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1118 [inline] copy_process+0x13e3/0x74b0 kernel/fork.c:2332 kernel_clone+0xfd/0x920 kernel/fork.c:2907 __do_sys_clone+0xba/0x100 kernel/fork.c:3050 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 slab_destroy mm/slab.c:1608 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1628 cache_flusharray mm/slab.c:3341 [inline] ___cache_free+0x2b7/0x420 mm/slab.c:3404 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x159/0x3f0 mm/slab.c:3432 mt_alloc_one lib/maple_tree.c:160 [inline] mas_alloc_nodes+0x182/0x830 lib/maple_tree.c:1265 mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1345 mas_preallocate+0x2d7/0xda0 lib/maple_tree.c:5520 vma_iter_prealloc mm/internal.h:1149 [inline] vma_expand+0x64b/0x12c0 mm/mmap.c:658 mmap_region+0x8db/0x2820 mm/mmap.c:2822 do_mmap+0x893/0xef0 mm/mmap.c:1379 vm_mmap_pgoff+0x1a8/0x3b0 mm/util.c:546 ksys_mmap_pgoff+0x7d/0x5b0 mm/mmap.c:1425 Memory state around the buggy address: ffffc900033cfa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900033cfb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900033cfb80: 00 00 00 00 00 00 f1 f1 f1 f1 04 f3 f3 f3 00 00 ^ ffffc900033cfc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900033cfc80: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 ================================================================== ---------------- Code disassembly (best guess): 0: 74 36 je 0x38 2: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 9: fc ff df c: 49 89 de mov %rbx,%r14 f: 48 89 dd mov %rbx,%rbp 12: 49 c1 ee 03 shr $0x3,%r14 16: 83 e5 07 and $0x7,%ebp 19: 49 01 c6 add %rax,%r14 1c: 83 c5 03 add $0x3,%ebp 1f: f3 90 pause 21: 41 0f b6 06 movzbl (%r14),%eax 25: 40 38 c5 cmp %al,%bpl 28: 7c 08 jl 0x32 * 2a: 84 c0 test %al,%al <-- trapping instruction 2c: 0f 85 19 01 00 00 jne 0x14b 32: 8b 03 mov (%rbx),%eax 34: 84 c0 test %al,%al 36: 75 e7 jne 0x1f 38: 48 c7 c0 a8 34 e1 8c mov $0xffffffff8ce134a8,%rax 3f: 48 rex.W