CVE-2026-31590: KVM: SEV: Drop WARN on large size for KVM_MEMORY_ENCRYPT_REG_REGION

Published Apr 24, 2026
·
Updated

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

KVM: SEV: Drop WARN on large size for KVMMEMORYENCRYPTREGREGION

Drop the WARN in sevpinmemory() on npages overflowing an int, as the WARN is comically trivially to trigger from userspace, e.g. by doing:

struct kvmencregion range = { .addr = 0, .size = -1ul, };

vmioctl(vm, KVMMEMORYENCRYPTREGREGION, &range);

Note, the checks in sevmemencregisterregion() that presumably exist to verify the incoming address+size are completely worthless, as both "addr" and "size" are u64s and SEV is 64-bit only, i.e. they can't be greater than ULONGMAX. That wart will be cleaned up in the near future.

if (range->addr > ULONGMAX || range->size > ULONGMAX) return -EINVAL;

Opportunistically add a comment to explain why the code calculates the number of pages the "hard" way, e.g. instead of just shifting @ulen.

Affected Software

9 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.134.1-2
Linux Linux kernel>=5.9<6.6.136
Linux Linux kernel>=6.7<6.12.83
Linux Linux kernel>=6.13<6.18.24
Linux Linux kernel>=6.19<6.19.14
Linux Linux kernel>=7.0<7.0.1
Microsoft azl3 kernel 6.6.134.1-2<6.6.137.1-1
6.6.137.1-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.6.137.1-1
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1

Event History

Apr 24, 2026
CVE Published
via MITRE·02:42 PM
Data Sourced
via MITRE·02:42 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityAffected Software
Apr 26, 2026
Data Sourced
via Microsoft·08:02 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

Who can trigger this issue?

A local attacker with low privileges who can issue the KVM_MEMORY_ENCRYPT_REG_REGION ioctl against a KVM VM can trigger the warning condition. The affected path is KVM's SEV memory-encryption region registration handling.

2

What input is used to trigger the condition?

The condition can be trivially triggered by supplying a region with address zero and an extremely large size, such as an unsigned size value of -1. This causes the calculated page count to overflow an int and previously generated a WARN.

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