Skip to contentSkip to conversation

CVE-2022-49933: KVM: VMX: Reset eVMCS controls in VP assist page during hardware disabling

DISCUSSION Greg Kroah-Hartman 2 participants 3 messages May 2, 2025 – May 20, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

KVM: VMX: Reset eVMCS controls in VP assist page during hardware disabling

Reset the eVMCS controls in the per-CPU VP assist page during hardware disabling instead of waiting until kvm-intel's module exit. The controls are activated if and only if KVM creates a VM, i.e. don't need to be reset if hardware is never enabled.

Doing the reset during hardware disabling will naturally fix a potential NULL pointer deref bug once KVM disables CPU hotplug while enabling and disabling hardware (which is necessary to fix a variety of bugs). If the kernel is running as the root partition, the VP assist page is unmapped during CPU hot unplug, and so KVM's clearing of the eVMCS controls needs to occur with CPU hot(un)plug disabled, otherwise KVM could attempt to write to a CPU's VP assist page after it's unmapped.

The Linux kernel CVE team has assigned CVE-2022-49933 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.1.20 with commit afb26bfc01db6ef4728e96314f08431934ffe833
	Fixed in 6.2.7 with commit 01aa8e5704bac9fcd7401eb1a74a375fba594203
	Fixed in 6.3 with commit 2916b70fc342719f570640de07251b7f91feebdb

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2022-49933

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:

	arch/x86/kvm/vmx/vmx.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/afb26bfc01db6ef4728e96314f08431934ffe833
	https://git.kernel.org/stable/c/01aa8e5704bac9fcd7401eb1a74a375fba594203
	https://git.kernel.org/stable/c/2916b70fc342719f570640de07251b7f91feebdb
#1 lore raw
Quoted 22 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

KVM: VMX: Reset eVMCS controls in VP assist page during hardware disabling

Reset the eVMCS controls in the per-CPU VP assist page during hardware disabling instead of waiting until kvm-intel's module exit. The controls are activated if and only if KVM creates a VM, i.e. don't need to be reset if hardware is never enabled.

Doing the reset during hardware disabling will naturally fix a potential NULL pointer deref bug once KVM disables CPU hotplug while enabling and disabling hardware (which is necessary to fix a variety of bugs). If the kernel is running as the root partition, the VP assist page is unmapped during CPU hot unplug, and so KVM's clearing of the eVMCS controls needs to occur with CPU hot(un)plug disabled, otherwise KVM could attempt to write to a CPU's VP assist page after it's unmapped.

Quoted 1 line

The Linux kernel CVE team has assigned CVE-2022-49933 to this issue.

Is this really a security issue?

I don't see how an unprivileged user could trigger the mentioned NULL deref, as it requires CPU hotunplug (can't be triggered by user) to happen in parallel with unloading the kvm module (can't be triggered by user either).

Juergen

author
#2 lore raw
Quoted 23 lines · Juergen Gross
Quoted 22 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

KVM: VMX: Reset eVMCS controls in VP assist page during hardware disabling

Reset the eVMCS controls in the per-CPU VP assist page during hardware disabling instead of waiting until kvm-intel's module exit. The controls are activated if and only if KVM creates a VM, i.e. don't need to be reset if hardware is never enabled.

Doing the reset during hardware disabling will naturally fix a potential NULL pointer deref bug once KVM disables CPU hotplug while enabling and disabling hardware (which is necessary to fix a variety of bugs). If the kernel is running as the root partition, the VP assist page is unmapped during CPU hot unplug, and so KVM's clearing of the eVMCS controls needs to occur with CPU hot(un)plug disabled, otherwise KVM could attempt to write to a CPU's VP assist page after it's unmapped.

Quoted 7 lines
Quoted 1 line

The Linux kernel CVE team has assigned CVE-2022-49933 to this issue.

Is this really a security issue?

I don't see how an unprivileged user could trigger the mentioned NULL deref, as it requires CPU hotunplug (can't be triggered by user) to happen in parallel with unloading the kvm module (can't be triggered by user either).

Now rejected, thanks for the review! This came in from the big "GSD import" which is why it is for an old issue like this.

thanks again,

greg k-h