================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 Read of size 8 at addr ffff8881ef4ef860 by task syz.0.302/1424 CPU: 1 PID: 1424 Comm: syz.0.302 Not tainted 5.4.274-syzkaller-00002-g6f97bd951d82 #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+0xa9/0x1b0 kernel/locking/spinlock.c:151 Code: 00 00 00 c7 44 24 20 00 00 00 00 4c 89 ef be 04 00 00 00 e8 79 ed 42 fd 4c 89 ff be 04 00 00 00 e8 6c ed 42 fd 43 0f b6 04 26 <84> c0 0f 85 aa 00 00 00 8b 44 24 20 b9 01 00 00 00 f0 41 0f b1 4d RSP: 0018:ffff8881ef4ef860 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000004 RBX: 1ffff1103de9df0c RCX: ffffffff84510734 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881ef4ef880 RBP: ffff8881ef4ef8f0 R08: dffffc0000000000 R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000 R13: ffffea00077135a8 R14: 1ffff1103de9df10 R15: ffff8881ef4ef880 spin_lock include/linux/spinlock.h:338 [inline] __get_locked_pte+0x276/0x330 mm/memory.c:1468 get_locked_pte include/linux/mm.h:1874 [inline] __munlock_pagevec_fill mm/mlock.c:387 [inline] munlock_vma_pages_range+0x2a5/0x13c0 mm/mlock.c:498 munlock_vma_pages_all mm/internal.h:302 [inline] exit_mmap+0x1e8/0x520 mm/mmap.c:3175 __mmput+0x8e/0x2c0 kernel/fork.c:1101 exit_mm kernel/exit.c:536 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:846 do_group_exit+0x138/0x300 kernel/exit.c:982 __do_sys_exit_group kernel/exit.c:993 [inline] __se_sys_exit_group kernel/exit.c:991 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:991 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f9ebf931b29 Code: Bad RIP value. RSP: 002b:00007ffcfac4c9c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9ebf931b29 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000001 R08: 00000008fac4cadf R09: 0000000000001388 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000032 R13: 0000000000001388 R14: 00007ffcfac4caa0 R15: 00007ffcfac4caa0 The buggy address belongs to the page: page:ffffea0007bd3bc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 0000000000000000 ffffea0007bd3bc8 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_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 __free_slab+0x221/0x2e0 mm/slub.c:1774 __slab_free+0x34b/0x360 mm/slub.c:3012 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1d9/0x210 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x41/0x210 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 getname_flags+0xb8/0x4e0 fs/namei.c:141 do_sys_open+0x357/0x810 fs/open.c:1117 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 addr ffff8881ef4ef860 is located in stack of task syz.0.302/1424 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: ffff8881ef4ef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ef4ef780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881ef4ef800: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ^ ffff8881ef4ef880: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ef4ef900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 00 c7 add %al,%bh 4: 44 24 20 rex.R and $0x20,%al 7: 00 00 add %al,(%rax) 9: 00 00 add %al,(%rax) b: 4c 89 ef mov %r13,%rdi e: be 04 00 00 00 mov $0x4,%esi 13: e8 79 ed 42 fd call 0xfd42ed91 18: 4c 89 ff mov %r15,%rdi 1b: be 04 00 00 00 mov $0x4,%esi 20: e8 6c ed 42 fd call 0xfd42ed91 25: 43 0f b6 04 26 movzbl (%r14,%r12,1),%eax * 2a: 84 c0 test %al,%al <-- trapping instruction 2c: 0f 85 aa 00 00 00 jne 0xdc 32: 8b 44 24 20 mov 0x20(%rsp),%eax 36: b9 01 00 00 00 mov $0x1,%ecx 3b: f0 lock 3c: 41 rex.B 3d: 0f .byte 0xf 3e: b1 4d mov $0x4d,%cl