================================================================== BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42 Read of size 8 at addr ffff8881f2fcfce0 by task syz-executor114/446 CPU: 1 PID: 446 Comm: syz-executor114 Not tainted 5.4.210-syzkaller-00003-g5a34019eb955 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 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+0xb0/0xf0 kernel/profile.c:409 tick_sched_handle kernel/time/tick-sched.c:172 [inline] tick_sched_timer+0x269/0x410 kernel/time/tick-sched.c:1296 __run_hrtimer+0x187/0x7c0 kernel/time/hrtimer.c:1581 __hrtimer_run_queues kernel/time/hrtimer.c:1643 [inline] hrtimer_interrupt+0x5d1/0x1140 kernel/time/hrtimer.c:1705 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1123 [inline] smp_apic_timer_interrupt+0x109/0x440 arch/x86/kernel/apic/apic.c:1148 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:831 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+0xbe/0x1b0 kernel/locking/spinlock.c:151 Code: 4f fd 4c 89 ff be 04 00 00 00 e8 4d 00 4f fd 43 8a 04 26 84 c0 0f 85 a9 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:ffff8881f2fcfce0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 1ffff1103e5f9f9c RCX: 0000000000000001 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881f2fcfd00 RBP: ffff8881f2fcfd68 R08: dffffc0000000000 R09: 0000000000000003 R10: ffffed103e5f9fa1 R11: 1ffff1103e5f9fa0 R12: dffffc0000000000 R13: ffff8881f27c8d80 R14: 1ffff1103e5f9fa0 R15: ffff8881f2fcfd00 spin_lock include/linux/spinlock.h:338 [inline] __alloc_fd+0x3b/0x580 fs/file.c:487 do_sys_open+0x36b/0x7e0 fs/open.c:1111 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f27a21df069 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd419d1a78 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000005671 RCX: 00007f27a21df069 RDX: 0000000000000000 RSI: 00000000010600c2 RDI: 00000000200000c0 RBP: 0000000000000000 R08: 00007ffd419d1c18 R09: 00007ffd419d1c18 R10: 00007ffd419d1c18 R11: 0000000000000246 R12: 00007ffd419d1a8c R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea0007cbf3c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 0000000000000000 ffffea0007cbf388 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 0x400dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x372/0x860 mm/page_alloc.c:4857 __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/0x5a0 kernel/fork.c:875 copy_process+0x56e/0x3230 kernel/fork.c:1878 _do_fork+0x196/0x8d0 kernel/fork.c:2391 __do_sys_clone kernel/fork.c:2549 [inline] __se_sys_clone kernel/fork.c:2530 [inline] __x64_sys_clone+0x287/0x2f0 kernel/fork.c:2530 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 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+0x7fe/0x930 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4919 [inline] __free_pages+0x8f/0x250 mm/page_alloc.c:4925 __free_slab+0x22b/0x2e0 mm/slub.c:1774 free_slab mm/slub.c:1789 [inline] discard_slab mm/slub.c:1795 [inline] unfreeze_partials+0x14f/0x180 mm/slub.c:2288 put_cpu_partial+0xb5/0x150 mm/slub.c:2324 __slab_free+0x2ac/0x370 mm/slub.c:2971 qlist_free_all+0x4c/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x174/0x190 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x43/0x1e0 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+0xd0/0x210 mm/slub.c:2842 kmem_cache_alloc_node include/linux/slab.h:427 [inline] __alloc_skb+0x78/0x4d0 net/core/skbuff.c:198 alloc_skb_fclone include/linux/skbuff.h:1110 [inline] sk_stream_alloc_skb+0x1ee/0xa80 net/ipv4/tcp.c:887 tcp_sendmsg_locked+0xe3f/0x3780 net/ipv4/tcp.c:1296 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1446 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] sock_write_iter+0x33f/0x460 net/socket.c:990 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5e3/0x780 fs/read_write.c:496 addr ffff8881f2fcfce0 is located in stack of task syz-executor114/446 at offset 0 in frame: _raw_spin_lock+0x0/0x1b0 arch/x86/include/asm/atomic.h:200 this frame has 1 object: [32, 36) 'val.i.i.i' Memory state around the buggy address: ffff8881f2fcfb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881f2fcfc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881f2fcfc80: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ^ ffff8881f2fcfd00: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881f2fcfd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 4f fd rex.WRXB std 2: 4c 89 ff mov %r15,%rdi 5: be 04 00 00 00 mov $0x4,%esi a: e8 4d 00 4f fd callq 0xfd4f005c f: 43 8a 04 26 mov (%r14,%r12,1),%al 13: 84 c0 test %al,%al 15: 0f 85 a9 00 00 00 jne 0xc4 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