================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 Read of size 8 at addr ffff8881d94d7800 by task udevd/414 CPU: 1 PID: 414 Comm: udevd Not tainted 5.4.276-syzkaller-04920-g3ffe89ed1bf9 #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+0xc0/0x1b0 kernel/locking/spinlock.c:151 Code: fd 4c 89 ff be 04 00 00 00 e8 1c dc 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 00 <75> 33 48 c7 04 24 0e 36 e0 45 49 c7 04 1c 00 00 00 00 65 48 8b 04 RSP: 0018:ffff8881d94d7800 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 1ffff1103b29af00 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881d94d7820 RBP: ffff8881d94d78a0 R08: dffffc0000000000 R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff8881ee03e5c0 R14: 1ffff1103b29af04 R15: ffff8881d94d7820 spin_lock include/linux/spinlock.h:338 [inline] inode_sb_list_add fs/inode.c:460 [inline] new_inode+0x66/0x1d0 fs/inode.c:958 shmem_get_inode+0x10b/0x620 mm/shmem.c:2252 shmem_mknod+0x54/0x1a0 mm/shmem.c:2844 lookup_open fs/namei.c:3379 [inline] do_last fs/namei.c:3471 [inline] path_openat+0x184a/0x34b0 fs/namei.c:3683 do_filp_open+0x20b/0x450 fs/namei.c:3713 do_sys_open+0x39c/0x810 fs/open.c:1123 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f94e1bca9a4 Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007fffedfd8490 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f94e1bca9a4 RDX: 0000000000080241 RSI: 00007fffedfd89d8 RDI: 00000000ffffff9c RBP: 00007fffedfd89d8 R08: 0000000000000004 R09: 0000000000000001 R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000080241 R13: 000055ba1d61b72e R14: 0000000000000001 R15: 000055ba1d636160 The buggy address belongs to the page: page:ffffea00076535c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea00076535c8 ffffea00076535c8 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_owner free stack trace missing addr ffff8881d94d7800 is located in stack of task udevd/414 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: ffff8881d94d7700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881d94d7780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881d94d7800: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00 ^ ffff8881d94d7880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881d94d7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: fd std 1: 4c 89 ff mov %r15,%rdi 4: be 04 00 00 00 mov $0x4,%esi 9: e8 1c dc 42 fd call 0xfd42dc2a e: 43 0f b6 04 26 movzbl (%r14,%r12,1),%eax 13: 84 c0 test %al,%al 15: 0f 85 aa 00 00 00 jne 0xc5 1b: 8b 44 24 20 mov 0x20(%rsp),%eax 1f: b9 01 00 00 00 mov $0x1,%ecx 24: f0 41 0f b1 4d 00 lock cmpxchg %ecx,0x0(%r13) * 2a: 75 33 jne 0x5f <-- trapping instruction 2c: 48 c7 04 24 0e 36 e0 movq $0x45e0360e,(%rsp) 33: 45 34: 49 c7 04 1c 00 00 00 movq $0x0,(%r12,%rbx,1) 3b: 00 3c: 65 gs 3d: 48 rex.W 3e: 8b .byte 0x8b 3f: 04 .byte 0x4