CVE-2026-98719

KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it

Published Oct 18, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it

Nullify have_run_cpus when freeing the mask, particularly in the error path
of __sev_guest_init(), so that KVM doesn't have to subtly use sev->active
to track whether or not the mask has been freed. As pointed out by Sashiko,
blindly freeing the mask in sev_vm_destroy() results in a double-free if
the mask is freed if __sev_guest_init() fails.

Throw the logic in a helper as nullifying the pointer is frustratingly
difficult and weird due to have_run_cpus being a single-entry array when
CPUMASK_OFFSTACK=n. Deliberately don't use CPUMASK_VAR_NULL, as it's not
directly assignable when the cpumask is on-stack, e.g. requires using a
local variable and a memcpy(), which is beyond ridiculous. Furthermore,
while clearing the on-stack bitmask is an unnecessary and arguably unwanted
side effect, KVM absolutely relies on '0' being the "null" value given that
the struct is zero-allocated.

Opportunistically add an alloc() helper to pair with free(); there are just
enough call sites to make doing so worthwhile.

Analysis

AI-generated

Technical impact

The flaw is a double‑free of the have_run_cpus mask within the SEV guest initialization code of KVM, an error that corrupts kernel memory and can be leveraged to execute code with kernel privileges or cause a crash. The exploitation vector hinges on creating or interfering with a SEV guest that triggers failure in __sev_guest_init(), causing the mask to be freed twice. This results in unpredictable memory corruption and the potential for privilege escalation on the host.

Affected Systems

Linux kernels that include the SEV module and have not been patched to nullify the have_run_cpus mask pointer when freeing it. Distributions that ship kernels with SEV enabled and lack the commit that adds the fix are vulnerable. No specific version information is supplied, so any kernel build that loads the sev module without the patch is considered affected.

Risk and Exploitability

Without an applied kernel patch, any process able to create a SEV guest on the host can trigger the double‑free path. The EPSS score indicates a very low probability of exploitation (<1%, approximately 0.00166), but the CVSS score of 5.5 indicates a moderate severity. The vulnerability is not listed in CISA’s KEV catalog, suggesting no known active exploitation, yet the potential for kernel code execution warrants immediate patching.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel patch that nullifies the have_run_cpus mask pointer before freeing in the SEV module (apply the commit that introduced the fix or a backported patch).
  • Reboot the system to load the updated kernel and ensure the patched module is in use.
  • If a kernel upgrade is not feasible, disable SEV support in KVM or prevent the sev.ko module from loading to eliminate the vulnerable code path.

Generated by OpenCVE AI on October 23, 2026 at 06:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-9018-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9018-2 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-1341
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it Nullify have_run_cpus when freeing the mask, particularly in the error path of __sev_guest_init(), so that KVM doesn't have to subtly use sev->active to track whether or not the mask has been freed. As pointed out by Sashiko, blindly freeing the mask in sev_vm_destroy() results in a double-free if the mask is freed if __sev_guest_init() fails. Throw the logic in a helper as nullifying the pointer is frustratingly difficult and weird due to have_run_cpus being a single-entry array when CPUMASK_OFFSTACK=n. Deliberately don't use CPUMASK_VAR_NULL, as it's not directly assignable when the cpumask is on-stack, e.g. requires using a local variable and a memcpy(), which is beyond ridiculous. Furthermore, while clearing the on-stack bitmask is an unnecessary and arguably unwanted side effect, KVM absolutely relies on '0' being the "null" value given that the struct is zero-allocated. Opportunistically add an alloc() helper to pair with free(); there are just enough call sites to make doing so worthwhile.
Title KVM: SEV: Nullify "have run CPUs" mask pointer when freeing it
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-1341

    Multiple Releases of Same Resource or Handle

  • CWE-416

    Use After Free

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 9:24 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Oct 18, 2026, 4:17 PM
Modified
Oct 19, 2026, 10:19 AM
Severity
Moderate
Public date
Oct 18, 2026, 12:00 AM