CVE-2021-47092: KVM: VMX: Always clear vmx->fail on emulation_required

Published Mar 4, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

KVM: VMX: Always clear vmx->fail on emulationrequired

Revert a relatively recent change that set vmx->fail if the vCPU is in L2 and emulationrequired is true, as that behavior is completely bogus. Setting vmx->fail and synthesizing a VM-Exit is contradictory and wrong:

(a) it's impossible to have both a VM-Fail and VM-Exit (b) vmcs.EXITREASON is not modified on VM-Fail (c) emulationrequired refers to guest state and guest state checks are always VM-Exits, not VM-Fails.

For KVM specifically, emulationrequired is handled before nested exits in vmxhandleexit(), thus setting vmx->fail has no immediate effect, i.e. KVM calls into handleinvalidgueststate() and vmx->fail is ignored. Setting vmx->fail can ultimately result in a WARN in nestedvmxvmexit() firing when tearing down the VM as KVM never expects vmx->fail to be set when L2 is active, KVM always reflects those errors into L1.

------------[ cut here ]------------ WARNING: CPU: 0 PID: 21158 at arch/x86/kvm/vmx/nested.c:4548 nestedvmxvmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 Modules linked in: CPU: 0 PID: 21158 Comm: syz-executor.1 Not tainted 5.16.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:nestedvmxvmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 Code: <0f> 0b e9 2e f8 ff ff e8 57 b3 5d 00 0f 0b e9 00 f1 ff ff 89 e9 80 Call Trace: vmxleavenested arch/x86/kvm/vmx/nested.c:6220 [inline] nestedvmxfreevcpu+0x83/0xc0 arch/x86/kvm/vmx/nested.c:330 vmxfreevcpu+0x11f/0x2a0 arch/x86/kvm/vmx/vmx.c:6799 kvmarchvcpudestroy+0x6b/0x240 arch/x86/kvm/x86.c:10989 kvmvcpudestroy+0x29/0x90 arch/x86/kvm/../../../virt/kvm/kvmmain.c:441 kvmfreevcpus arch/x86/kvm/x86.c:11426 [inline] kvmarchdestroyvm+0x3ef/0x6b0 arch/x86/kvm/x86.c:11545 kvmdestroyvm arch/x86/kvm/../../../virt/kvm/kvmmain.c:1189 [inline] kvmputkvm+0x751/0xe40 arch/x86/kvm/../../../virt/kvm/kvmmain.c:1220 kvmvcpurelease+0x53/0x60 arch/x86/kvm/../../../virt/kvm/kvmmain.c:3489 fput+0x3fc/0x870 fs/filetable.c:280 taskworkrun+0x146/0x1c0 kernel/taskwork.c:164 exittaskwork include/linux/taskwork.h:32 [inline] doexit+0x705/0x24f0 kernel/exit.c:832 dogroupexit+0x168/0x2d0 kernel/exit.c:929 getsignal+0x1740/0x2120 kernel/signal.c:2852 archdosignalorrestart+0x9c/0x730 arch/x86/kernel/signal.c:868 handlesignalwork kernel/entry/common.c:148 [inline] exittousermodeloop kernel/entry/common.c:172 [inline] exittousermodeprepare+0x191/0x220 kernel/entry/common.c:207 syscallexittousermodework kernel/entry/common.c:289 [inline] syscallexittousermode+0x2e/0x70 kernel/entry/common.c:300 dosyscall64+0x53/0xd0 arch/x86/entry/common.c:86 entrySYSCALL64afterhwframe+0x44/0xae

Affected Software

8 affected components
Linux Linux kernel
Linux Linux kernel>=5.15<5.15.12
Linux Linux kernel=5.16-rc1
Linux Linux kernel=5.16-rc2
Linux Linux kernel=5.16-rc3
Linux Linux kernel=5.16-rc4
Linux Linux kernel=5.16-rc5
Linux Linux kernel=5.16-rc6

Event History

Mar 4, 2024
CVE Published
via MITRE·06:10 PM
Data Sourced
via MITRE·06:10 PM
Description
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2021-47092?

CVE-2021-47092 has a high severity rating due to potential instability in the KVM virtualization environment.

2

How do I fix CVE-2021-47092?

To fix CVE-2021-47092, update the Linux kernel to version 5.15.12 or later.

3

What systems are affected by CVE-2021-47092?

CVE-2021-47092 affects Linux kernel versions prior to 5.15.12 and includes the 5.16 release candidates.

4

What impact does CVE-2021-47092 have on virtualization?

CVE-2021-47092 can cause failures in the KVM virtualization process, potentially impacting VM stability.

5

Is CVE-2021-47092 related to any specific Linux distribution?

CVE-2021-47092 is related to the Linux kernel and can affect any Linux distribution utilizing the affected kernel versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203