================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 Read of size 8 at addr ffff8881a7e9f680 by task syz.1.2978/11881 CPU: 1 PID: 11881 Comm: syz.1.2978 Not tainted 5.4.274-syzkaller-00003-g51e9abf68baf #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 profile_tick+0xb9/0x100 kernel/profile.c:416 tick_sched_handle kernel/time/tick-sched.c:206 [inline] tick_sched_timer+0x237/0x3c0 kernel/time/tick-sched.c:1342 __run_hrtimer kernel/time/hrtimer.c:1581 [inline] __hrtimer_run_queues+0x3e9/0xb90 kernel/time/hrtimer.c:1643 hrtimer_interrupt+0x38a/0x890 kernel/time/hrtimer.c:1705 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1122 [inline] smp_apic_timer_interrupt+0x110/0x460 arch/x86/kernel/apic/apic.c:1147 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:200 [inline] RIP: 0010:atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:695 [inline] RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:78 [inline] RIP: 0010:do_raw_spin_lock include/linux/spinlock.h:181 [inline] RIP: 0010:__raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline] RIP: 0010:_raw_spin_lock+0x160/0x1b0 kernel/locking/spinlock.c:151 Code: fc fa fc 66 90 eb 85 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 34 ff ff ff 4c 89 ff e8 da 19 43 fd e9 27 ff ff ff 48 8d 4c 24 20 <80> e1 07 80 c1 03 38 c1 0f 8c 43 ff ff ff 48 8d 7c 24 20 e8 48 19 RSP: 0018:ffff8881a7e9f680 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000004 RBX: 1ffff11034fd3ed0 RCX: ffff8881a7e9f6a0 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881a7e9f6a0 RBP: ffff8881a7e9f718 R08: dffffc0000000000 R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000 R13: ffffea0007996ce8 R14: 1ffff11034fd3ed4 R15: ffff8881a7e9f6a0 spin_lock include/linux/spinlock.h:338 [inline] pte_alloc_one_map mm/memory.c:3344 [inline] alloc_set_pte+0xba2/0x1170 mm/memory.c:3463 filemap_map_pages+0x9d8/0xdd0 mm/filemap.c:2812 do_fault_around mm/memory.c:3627 [inline] do_read_fault mm/memory.c:3662 [inline] do_fault mm/memory.c:3797 [inline] handle_pte_fault mm/memory.c:4028 [inline] __handle_mm_fault mm/memory.c:4152 [inline] handle_mm_fault+0x25cd/0x4990 mm/memory.c:4189 faultin_page mm/gup.c:654 [inline] __get_user_pages+0xc0b/0x13b0 mm/gup.c:874 populate_vma_page_range mm/gup.c:1279 [inline] __mm_populate+0x369/0x510 mm/gup.c:1327 mm_populate include/linux/mm.h:2489 [inline] vm_mmap_pgoff+0x20d/0x260 mm/util.c:533 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fe13be18b99 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe13b09a048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fe13bfa6fa0 RCX: 00007fe13be18b99 RDX: b635773f06ebbeee RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 00007fe13be9977e R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe13bfa6fa0 R15: 00007ffe89ff7e28 The buggy address belongs to the page: page:ffffea00069fa7c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea00069fa7c8 ffffea00069fa7c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 __alloc_pages include/linux/gfp.h:503 [inline] __alloc_pages_node include/linux/gfp.h:516 [inline] alloc_pages_node include/linux/gfp.h:530 [inline] alloc_thread_stack_node kernel/fork.c:259 [inline] dup_task_struct+0x85/0x600 kernel/fork.c:886 copy_process+0x56d/0x3230 kernel/fork.c:1889 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone3 kernel/fork.c:2688 [inline] __se_sys_clone3 kernel/fork.c:2675 [inline] __x64_sys_clone3+0x2da/0x300 kernel/fork.c:2675 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page_owner free stack trace missing addr ffff8881a7e9f680 is located in stack of task syz.1.2978/11881 at offset 0 in frame: _raw_spin_lock+0x0/0x1b0 this frame has 1 object: [32, 36) 'val.i.i.i' Memory state around the buggy address: ffff8881a7e9f580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881a7e9f600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881a7e9f680: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00 ^ ffff8881a7e9f700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881a7e9f780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: fc cld 1: fa cli 2: fc cld 3: 66 90 xchg %ax,%ax 5: eb 85 jmp 0xffffff8c 7: 44 89 f9 mov %r15d,%ecx a: 80 e1 07 and $0x7,%cl d: 80 c1 03 add $0x3,%cl 10: 38 c1 cmp %al,%cl 12: 0f 8c 34 ff ff ff jl 0xffffff4c 18: 4c 89 ff mov %r15,%rdi 1b: e8 da 19 43 fd call 0xfd4319fa 20: e9 27 ff ff ff jmp 0xffffff4c 25: 48 8d 4c 24 20 lea 0x20(%rsp),%rcx * 2a: 80 e1 07 and $0x7,%cl <-- trapping instruction 2d: 80 c1 03 add $0x3,%cl 30: 38 c1 cmp %al,%cl 32: 0f 8c 43 ff ff ff jl 0xffffff7b 38: 48 8d 7c 24 20 lea 0x20(%rsp),%rdi 3d: e8 .byte 0xe8 3e: 48 rex.W 3f: 19 .byte 0x19