==================================================================
BUG: KASAN: stack-out-of-bounds in profile_pc+0xa4/0xe0 arch/x86/kernel/time.c:42
Read of size 8 at addr ffff8881ef23f560 by task syz.1.2433/10335
CPU: 1 PID: 10335 Comm: syz.1.2433 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:native_irq_disable arch/x86/include/asm/irqflags.h:49 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:89 [inline]
RIP: 0010:__raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline]
RIP: 0010:_raw_spin_lock_irq+0x64/0x1b0 kernel/locking/spinlock.c:167
Code: 8a b5 41 48 c7 44 24 08 97 7f 58 85 48 c7 44 24 10 80 18 51 84 48 89 e3 48 c1 eb 03 48 b8 f1 f1 f1 f1 04 f3 f3 f3 4a 89 04 23 bf 01 00 00 00 e8 b1 c5 f3 fc 4d 89 fe 49 c1 ee 03 43 0f b6 04
RSP: 0018:ffff8881ef23f560 EFLAGS: 00000a06 ORIG_RAX: ffffffffffffff13
RAX: f3f3f304f1f1f1f1 RBX: 1ffff1103de47eac RCX: 0000000000040000
RDX: ffffc90001a2b000 RSI: 000000000003ffff RDI: ffff8881eb6754d0
RBP: ffff8881ef23f5f0 R08: ffffffff818204cd R09: fffff94000e02bd1
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8881eb6754d0 R14: 0000000000000001 R15: ffff8881ef23f580
spin_lock_irq include/linux/spinlock.h:363 [inline]
shmem_getpage_gfp+0x1657/0x2440 mm/shmem.c:1901
shmem_fault+0x2d1/0x7b0 mm/shmem.c:2081
__do_fault mm/memory.c:3259 [inline]
do_read_fault mm/memory.c:3668 [inline]
do_fault mm/memory.c:3797 [inline]
handle_pte_fault mm/memory.c:4028 [inline]
__handle_mm_fault mm/memory.c:4152 [inline]
handle_mm_fault+0x344b/0x4990 mm/memory.c:4189
faultin_page mm/gup.c:654 [inline]
__get_user_pages+0xc0b/0x13b0 mm/gup.c:874
populate_vma_page_range mm/gup.c:1279 [inline]
__mm_populate+0x369/0x510 mm/gup.c:1327
mm_populate include/linux/mm.h:2489 [inline]
vm_mmap_pgoff+0x20d/0x260 mm/util.c:533
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7fc57df24b99
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc57d1a6048 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fc57e0b2fa0 RCX: 00007fc57df24b99
RDX: b635773f06ebbeee RSI: 0000000000b36000 RDI: 0000000020000000
RBP: 00007fc57dfa577e R08: ffffffffffffffff R09: 0000000000000000
R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fc57e0b2fa0 R15: 00007fffae851738
The buggy address belongs to the page:
page:ffffea0007bc8fc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 0000000000000000 ffffea0007bc8f88 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+0xd9/0x250 mm/slub.c:2842
getname_flags+0xb8/0x4e0 fs/namei.c:141
user_path_at_empty+0x28/0x50 fs/namei.c:2703
user_path_at include/linux/namei.h:49 [inline]
vfs_statx+0x115/0x210 fs/stat.c:187
vfs_fstatat include/linux/fs.h:3380 [inline]
__do_sys_newfstatat fs/stat.c:367 [inline]
__se_sys_newfstatat+0xce/0x770 fs/stat.c:361
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
addr ffff8881ef23f560 is located in stack of task syz.1.2433/10335 at offset 0 in frame:
pv_queued_spin_lock_slowpath arch/x86/include/asm/atomic.h:200 [inline]
queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:50 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:81 [inline]
do_raw_spin_lock_flags include/linux/spinlock.h:193 [inline]
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:119 [inline]
_raw_spin_lock_irq+0x0/0x1b0 kernel/locking/spinlock.c:159
this frame has 1 object:
[32, 36) 'val.i.i.i'
Memory state around the buggy address:
ffff8881ef23f400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881ef23f480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881ef23f500: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
^
ffff8881ef23f580: 04 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881ef23f600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 8a b5 41 48 c7 44 mov 0x44c74841(%rbp),%dh
6: 24 08 and $0x8,%al
8: 97 xchg %eax,%edi
9: 7f 58 jg 0x63
b: 85 48 c7 test %ecx,-0x39(%rax)
e: 44 24 10 rex.R and $0x10,%al
11: 80 18 51 sbbb $0x51,(%rax)
14: 84 48 89 test %cl,-0x77(%rax)
17: e3 48 jrcxz 0x61
19: c1 eb 03 shr $0x3,%ebx
1c: 48 b8 f1 f1 f1 f1 04 movabs $0xf3f3f304f1f1f1f1,%rax
23: f3 f3 f3
26: 4a 89 04 23 mov %rax,(%rbx,%r12,1)
* 2a: fa cli <-- trapping instruction
2b: bf 01 00 00 00 mov $0x1,%edi
30: e8 b1 c5 f3 fc call 0xfcf3c5e6
35: 4d 89 fe mov %r15,%r14
38: 49 c1 ee 03 shr $0x3,%r14
3c: 43 rex.XB
3d: 0f .byte 0xf
3e: b6 04 mov $0x4,%dh