==================================================================
BUG: KASAN: use-after-free in vmclear_local_loaded_vmcss arch/x86/kvm/vmx/vmx.c:2322 [inline]
BUG: KASAN: use-after-free in hardware_disable+0x10f/0x250 arch/x86/kvm/vmx/vmx.c:2341
Read of size 8 at addr ffff888101dd28f8 by task syz-executor.1/17230
CPU: 0 PID: 17230 Comm: syz-executor.1 Tainted: G W 5.10.93-syzkaller-01028-g0347b1658399 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
print_address_description+0x8d/0x3d0 mm/kasan/report.c:233
__kasan_report+0x142/0x220 mm/kasan/report.c:419
kasan_report+0x51/0x70 mm/kasan/report.c:436
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
vmclear_local_loaded_vmcss arch/x86/kvm/vmx/vmx.c:2322 [inline]
hardware_disable+0x10f/0x250 arch/x86/kvm/vmx/vmx.c:2341
kvm_arch_hardware_disable+0x16/0xe0 arch/x86/kvm/x86.c:10306
hardware_disable_nolock+0x77/0x80 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4119
flush_smp_call_function_queue+0x23b/0x6b0 kernel/smp.c:396
generic_smp_call_function_single_interrupt+0x13/0x20 kernel/smp.c:318
__sysvec_call_function_single+0x66/0x1b0 arch/x86/kernel/smp.c:248
asm_call_irq_on_stack+0xf/0x20
__run_sysvec_on_irqstack arch/x86/include/asm/irq_stack.h:37 [inline]
run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:89 [inline]
sysvec_call_function_single+0x85/0xe0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x12/0x20 arch/x86/include/asm/idtentry.h:643
RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64
Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01
RSP: 0018:ffffc900037afb90 EFLAGS: 00010246
RAX: ffff88810da00000 RBX: ffff88810da00000 RCX: 0000000000000540
RDX: 0000000000001000 RSI: 0000000000000000 RDI: ffff88810da00ac0
RBP: ffffc900037afc00 R08: ffffffff81d7ed18 R09: ffff88810da00000
R10: fffff520006f5fa8 R11: 0000000000000000 R12: ffff888100042c00
R13: ffff88810da00000 R14: 0000000000001001 R15: 0000000000000cc0
kmalloc include/linux/slab.h:557 [inline]
kernfs_file_read_iter fs/kernfs/file.c:195 [inline]
kernfs_fop_read_iter+0x177/0x490 fs/kernfs/file.c:242
call_read_iter include/linux/fs.h:1941 [inline]
new_sync_read fs/read_write.c:415 [inline]
vfs_read+0x9d4/0xbe0 fs/read_write.c:496
ksys_read+0x186/0x2b0 fs/read_write.c:634
__do_sys_read fs/read_write.c:644 [inline]
__se_sys_read fs/read_write.c:642 [inline]
__x64_sys_read+0x7b/0x90 fs/read_write.c:642
do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7fce1d6bdc0c
Code: ec 28 48 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 fc ff ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 48 89 44 24 08 e8 2f fd ff ff 48
RSP: 002b:00007fce1c8810c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007fce1d6bdc0c
RDX: 00000000008bf000 RSI: 00007fce1de962a0 RDI: 0000000000000005
RBP: 0000000000a00000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fce1dd552a0
R13: 0000000000141000 R14: 00007fce1c881300 R15: 0000000000022000
Allocated by task 17192:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:428 [inline]
__kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:461
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:583 [inline]
slab_alloc_node mm/slub.c:2954 [inline]
slab_alloc mm/slub.c:2962 [inline]
kmem_cache_alloc+0x1a2/0x380 mm/slub.c:2967
kmem_cache_zalloc include/linux/slab.h:654 [inline]
kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:3158 [inline]
kvm_vm_ioctl+0xd78/0x1fa0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3735
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x115/0x190 fs/ioctl.c:739
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739
do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Freed by task 17212:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:357
____kasan_slab_free+0x133/0x170 mm/kasan/common.c:360
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:368
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:1602 [inline]
slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1628
slab_free mm/slub.c:3210 [inline]
kmem_cache_free+0xb5/0x1f0 mm/slub.c:3226
kvm_vcpu_destroy+0x7e/0xb0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:428
kvm_free_vcpus arch/x86/kvm/x86.c:10470 [inline]
kvm_arch_destroy_vm+0x40f/0x6c0 arch/x86/kvm/x86.c:10565
kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:889 [inline]
kvm_put_kvm+0x95a/0x10a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:910
kvm_vm_release+0x46/0x50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:933
__fput+0x348/0x7d0 fs/file_table.c:281
____fput+0x15/0x20 fs/file_table.c:314
task_work_run+0x147/0x1b0 kernel/task_work.c:154
exit_task_work include/linux/task_work.h:30 [inline]
do_exit+0x70e/0x23a0 kernel/exit.c:813
do_group_exit+0x16a/0x2d0 kernel/exit.c:910
get_signal+0x131f/0x1f70 kernel/signal.c:2780
arch_do_signal+0x8d/0x620 arch/x86/kernel/signal.c:805
exit_to_user_mode_loop kernel/entry/common.c:161 [inline]
exit_to_user_mode_prepare+0xaa/0xe0 kernel/entry/common.c:191
syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266
do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56
entry_SYSCALL_64_after_hwframe+0x44/0xa9
The buggy address belongs to the object at ffff888101dd0000
which belongs to the cache kvm_vcpu of size 11328
The buggy address is located 10488 bytes inside of
11328-byte region [ffff888101dd0000, ffff888101dd2c40)
The buggy address belongs to the page:
page:ffffea0004077400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101dd0
head:ffffea0004077400 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 0000000000000000 0000000100000001 ffff8881047f5c80
raw: 0000000000000000 0000000000010001 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 16736, ts 725387736612, free_ts 624090175571
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2385 [inline]
prep_new_page mm/page_alloc.c:2391 [inline]
get_page_from_freelist+0xa74/0xa90 mm/page_alloc.c:4063
__alloc_pages_nodemask+0x3c8/0x820 mm/page_alloc.c:5106
alloc_slab_page mm/slub.c:1813 [inline]
allocate_slab+0x6b/0x350 mm/slub.c:1815
new_slab mm/slub.c:1876 [inline]
new_slab_objects mm/slub.c:2635 [inline]
___slab_alloc+0x143/0x2f0 mm/slub.c:2798
__slab_alloc mm/slub.c:2838 [inline]
slab_alloc_node mm/slub.c:2920 [inline]
slab_alloc mm/slub.c:2962 [inline]
kmem_cache_alloc+0x26f/0x380 mm/slub.c:2967
kmem_cache_zalloc include/linux/slab.h:654 [inline]
kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:3158 [inline]
kvm_vm_ioctl+0xd78/0x1fa0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3735
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x115/0x190 fs/ioctl.c:739
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739
do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1331 [inline]
__free_pages_ok+0xbe7/0xc20 mm/page_alloc.c:1611
free_the_page mm/page_alloc.c:5167 [inline]
__free_pages+0x2d6/0x4a0 mm/page_alloc.c:5173
kfree+0x29d/0x320 mm/slub.c:4195
bpf_check+0x595c/0x139f0 kernel/bpf/verifier.c:12530
bpf_prog_load kernel/bpf/syscall.c:2230 [inline]
__do_sys_bpf+0x103e6/0x116b0 kernel/bpf/syscall.c:4424
__se_sys_bpf kernel/bpf/syscall.c:4380 [inline]
__x64_sys_bpf+0x7a/0x90 kernel/bpf/syscall.c:4380
do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Memory state around the buggy address:
ffff888101dd2780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888101dd2800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888101dd2880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888101dd2900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888101dd2980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: c1 e9 03 shr $0x3,%ecx
3: 40 0f b6 f6 movzbl %sil,%esi
7: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax
e: 01 01 01
11: 48 0f af c6 imul %rsi,%rax
15: f3 48 ab rep stos %rax,%es:(%rdi)
18: 89 d1 mov %edx,%ecx
1a: f3 aa rep stos %al,%es:(%rdi)
1c: 4c 89 c8 mov %r9,%rax
1f: c3 retq
20: 90 nop
21: 49 89 f9 mov %rdi,%r9
24: 40 88 f0 mov %sil,%al
27: 48 89 d1 mov %rdx,%rcx
* 2a: f3 aa rep stos %al,%es:(%rdi) <-- trapping instruction
2c: 4c 89 c8 mov %r9,%rax
2f: c3 retq
30: 90 nop
31: 49 89 fa mov %rdi,%r10
34: 40 0f b6 ce movzbl %sil,%ecx
38: 48 rex.W
39: b8 01 01 01 01 mov $0x1010101,%eax
3e: 01 01 add %eax,(%rcx)