================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 Read of size 8 at addr ffff8881dd33fb60 by task syz-executor/1242 CPU: 0 PID: 1242 Comm: syz-executor 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:atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:693 [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+0x8a/0x1b0 kernel/locking/spinlock.c:151 Code: 4a 89 04 23 bf 01 00 00 00 e8 c2 da f3 fc 4d 89 fe 49 c1 ee 03 43 0f b6 04 26 84 c0 0f 85 bb 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 RSP: 0018:ffff8881dd33fb60 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000004 RBX: 1ffff1103ba67f6c RCX: 00000000dd33fb03 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: ffff8881dd33fc00 R08: ffffffff81a09c4d R09: ffffffff81a09c82 R10: ffff8881e0ee3f00 R11: 0000000000000003 R12: dffffc0000000000 R13: ffff8881d7dd75a8 R14: 1ffff1103ba67f70 R15: ffff8881dd33fb80 d_walk+0x2a6/0x4d0 fs/dcache.c:1306 shrink_dcache_parent+0x142/0x330 fs/dcache.c:1547 vfs_rmdir+0x2b5/0x3c0 fs/namei.c:4031 do_rmdir+0x2c1/0x580 fs/namei.c:4088 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f7e4ca831a7 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 07 01 00 00 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:00007ffc665cb7c8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f7e4ca831a7 RDX: 0000000000000200 RSI: 00007ffc665cc930 RDI: 00000000ffffff9c RBP: 00007f7e4caf164a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffc665cc930 R13: 00007f7e4caf164a R14: 000000000001029d R15: 00007ffc665cc970 The buggy address belongs to the page: page:ffffea000774cfc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea0007605f88 ffffea000774cf88 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_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4953 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4961 __vunmap+0x75b/0x890 mm/vmalloc.c:2260 kcov_put kernel/kcov.c:396 [inline] kcov_close+0x27/0x50 kernel/kcov.c:495 __fput+0x262/0x680 fs/file_table.c:281 task_work_run+0x140/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xcaf/0x2bc0 kernel/exit.c:859 do_group_exit+0x138/0x300 kernel/exit.c:982 get_signal+0xdb1/0x1440 kernel/signal.c:2735 do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 addr ffff8881dd33fb60 is located in stack of task syz-executor/1242 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: ffff8881dd33fa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881dd33fa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881dd33fb00: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ^ ffff8881dd33fb80: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881dd33fc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 4a 89 04 23 mov %rax,(%rbx,%r12,1) 4: bf 01 00 00 00 mov $0x1,%edi 9: e8 c2 da f3 fc call 0xfcf3dad0 e: 4d 89 fe mov %r15,%r14 11: 49 c1 ee 03 shr $0x3,%r14 15: 43 0f b6 04 26 movzbl (%r14,%r12,1),%eax 1a: 84 c0 test %al,%al 1c: 0f 85 bb 00 00 00 jne 0xdd 22: c7 44 24 20 00 00 00 movl $0x0,0x20(%rsp) 29: 00 * 2a: 4c 89 ef mov %r13,%rdi <-- trapping instruction 2d: be 04 00 00 00 mov $0x4,%esi 32: e8 79 ed 42 fd call 0xfd42edb0 37: 4c 89 ff mov %r15,%rdi 3a: be 04 00 00 00 mov $0x4,%esi 3f: e8 .byte 0xe8