==================================================================
BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42
Read of size 8 at addr ffff8881e7277bc0 by task syz.0.1031/4454
CPU: 0 PID: 4454 Comm: syz.0.1031 Not tainted 5.4.276-syzkaller-00020-g4275fce9fe94 #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+0x8d/0x1b0 kernel/locking/spinlock.c:151
Code: 23 bf 01 00 00 00 e8 72 c9 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 04 00 00 00 e8 39 dc 42 fd 4c 89 ff be 04 00 00 00 e8 2c dc 42
RSP: 0000:ffff8881e7277bc0 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000004 RBX: 1ffff1103ce4ef78 RCX: 00000000e7277b03
RDX: ffff8881dcc58000 RSI: 0000000000000000 RDI: ffffea0007a52c28
RBP: ffff8881e7277c50 R08: ffffffff818b8daf R09: ffff8881e7277d48
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffffea0007a52c28 R14: 1ffff1103ce4ef7c R15: ffff8881e7277be0
spin_lock include/linux/spinlock.h:338 [inline]
do_anonymous_page mm/memory.c:3151 [inline]
handle_pte_fault mm/memory.c:4026 [inline]
__handle_mm_fault mm/memory.c:4152 [inline]
handle_mm_fault+0x292e/0x4990 mm/memory.c:4189
do_user_addr_fault arch/x86/mm/fault.c:1469 [inline]
__do_page_fault+0x509/0xbb0 arch/x86/mm/fault.c:1530
page_fault+0x2f/0x40 arch/x86/entry/entry_64.S:1206
RIP: 0033:0x7f751e4d3fd6
Code: f0 72 6e 48 63 cd 48 01 c1 49 39 4f 08 72 4c 8d 4d ff 85 ed 74 33 66 0f 1f 44 00 00 48 39 f0 72 1b 4d 8b 07 49 89 c1 49 29 f1 <47> 0f b6 0c 08 45 84 c9 74 08 45 88 0c 00 49 8b 47 10 48 83 c0 01
RSP: 002b:00007f751d88f4b0 EFLAGS: 00010206
RAX: 0000000000135001 RBX: 00007f751d88f550 RCX: 00000000000000db
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f751d88f5f0
RBP: 0000000000000102 R08: 00007f7515470000 R09: 0000000000135000
R10: 0000000000000000 R11: 00007f751d88f560 R12: 0000000000000001
R13: 00007f751e68f0c0 R14: 0000000000000000 R15: 00007f751d88f5f0
The buggy address belongs to the page:
page:ffffea00079c9dc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 0000000000000000 ffffea00079c9dc8 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 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
free_slab mm/slub.c:1789 [inline]
discard_slab mm/slub.c:1795 [inline]
unfreeze_partials+0x14e/0x180 mm/slub.c:2288
put_cpu_partial+0x44/0x180 mm/slub.c:2324
__slab_free+0x297/0x360 mm/slub.c:2971
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_trace+0xdc/0x260 mm/slub.c:2854
kmem_cache_alloc_node_trace include/linux/slab.h:444 [inline]
kmalloc_node include/linux/slab.h:594 [inline]
kzalloc_node include/linux/slab.h:701 [inline]
__get_vm_area_node+0x183/0x310 mm/vmalloc.c:2059
__vmalloc_node_range+0xee/0x710 mm/vmalloc.c:2494
__vmalloc_node mm/vmalloc.c:2554 [inline]
__vmalloc_node_flags mm/vmalloc.c:2568 [inline]
vzalloc+0x70/0x80 mm/vmalloc.c:2613
alloc_counters+0x66/0x550 net/ipv4/netfilter/ip_tables.c:800
copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:839 [inline]
get_entries net/ipv6/netfilter/ip6_tables.c:1042 [inline]
do_ip6t_get_ctl+0x5b4/0xb60 net/ipv6/netfilter/ip6_tables.c:1712
nf_sockopt net/netfilter/nf_sockopt.c:104 [inline]
nf_getsockopt+0x28c/0x2b0 net/netfilter/nf_sockopt.c:122
addr ffff8881e7277bc0 is located in stack of task syz.0.1031/4454 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:
ffff8881e7277a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881e7277b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881e7277b80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f3 f3 f3
^
ffff8881e7277c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881e7277c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 23 bf 01 00 00 00 and 0x1(%rdi),%edi
6: e8 72 c9 f3 fc call 0xfcf3c97d
b: 4d 89 fe mov %r15,%r14
e: 49 c1 ee 03 shr $0x3,%r14
12: 43 0f b6 04 26 movzbl (%r14,%r12,1),%eax
17: 84 c0 test %al,%al
19: 0f 85 bb 00 00 00 jne 0xda
1f: c7 44 24 20 00 00 00 movl $0x0,0x20(%rsp)
26: 00
27: 4c 89 ef mov %r13,%rdi
* 2a: be 04 00 00 00 mov $0x4,%esi <-- trapping instruction
2f: e8 39 dc 42 fd call 0xfd42dc6d
34: 4c 89 ff mov %r15,%rdi
37: be 04 00 00 00 mov $0x4,%esi
3c: e8 .byte 0xe8
3d: 2c dc sub $0xdc,%al
3f: 42 rex.X