{"id":"CVE-2026-31558","state":"PUBLISHED","title":"LoongArch: KVM: Make kvm_get_vcpu_by_cpuid() more robust","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: KVM: Make kvm_get_vcpu_by_cpuid() more robust\n\nkvm_get_vcpu_by_cpuid() takes a cpuid parameter whose type is int, so\ncpuid can be negative. Let kvm_get_vcpu_by_cpuid() return NULL for this\ncase so as to make it more robust.\n\nThis fix an out-of-bounds access to kvm_arch::phyid_map::phys_map[].","publishedAt":"2026-04-24T14:35:41.209Z","updatedAt":"2026-08-05T12:23:30.748Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"596c3f8069c4792f22fce8c4452f44410032d910","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"878cf6acb4fd8ab4126cf9d369a5bb0e23123418","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"47857b05bd50db01e211a1b6f513d57901cd3e6b","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"2db06c15d8c7a0ccb6108524e16cd9163753f354","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/kvm/vcpu.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.80","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.21","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.11","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/kvm/vcpu.c"]}],"references":["https://git.kernel.org/stable/c/596c3f8069c4792f22fce8c4452f44410032d910","https://git.kernel.org/stable/c/878cf6acb4fd8ab4126cf9d369a5bb0e23123418","https://git.kernel.org/stable/c/47857b05bd50db01e211a1b6f513d57901cd3e6b","https://git.kernel.org/stable/c/2db06c15d8c7a0ccb6108524e16cd9163753f354"],"weaknesses":[],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31558.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31558","state":"PUBLISHED","datePublished":"2026-04-24T14:35:41.209Z","dateUpdated":"2026-08-05T12:23:30.748Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-03-09T15:48:24.116Z"},"containers":{"cna":{"title":"LoongArch: KVM: Make kvm_get_vcpu_by_cpuid() more robust","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: KVM: Make kvm_get_vcpu_by_cpuid() more robust\n\nkvm_get_vcpu_by_cpuid() takes a cpuid parameter whose type is int, so\ncpuid can be negative. Let kvm_get_vcpu_by_cpuid() return NULL for this\ncase so as to make it more robust.\n\nThis fix an out-of-bounds access to kvm_arch::phyid_map::phys_map[]."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"596c3f8069c4792f22fce8c4452f44410032d910","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"878cf6acb4fd8ab4126cf9d369a5bb0e23123418","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"47857b05bd50db01e211a1b6f513d57901cd3e6b","versionType":"git"},{"version":"73516e9da512adc63ba3859fbd82a21f6257348f","status":"affected","lessThan":"2db06c15d8c7a0ccb6108524e16cd9163753f354","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/kvm/vcpu.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.80","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.21","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.11","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/kvm/vcpu.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/596c3f8069c4792f22fce8c4452f44410032d910"},{"url":"https://git.kernel.org/stable/c/878cf6acb4fd8ab4126cf9d369a5bb0e23123418"},{"url":"https://git.kernel.org/stable/c/47857b05bd50db01e211a1b6f513d57901cd3e6b"},{"url":"https://git.kernel.org/stable/c/2db06c15d8c7a0ccb6108524e16cd9163753f354"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","baseScore":8.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Exploitation requires local ability to run/control a LoongArch KVM guest or access KVM ioctls through `/dev/kvm`; the vulnerable code is not reachable directly over a network.\nAC:L - The attacker can directly supply the negative CPUID condition through guest hypercall register state or KVM interrupt-controller state, and no race or external timing condition is required.\nPR:L - The attacker needs access to a KVM VM or `/dev/kvm`, but the path does not require real host root or an init-namespace capability once KVM access is available.\nUI:N - No victim user action is required after the attacker can run the guest/KVM operation; the trigger is a direct hypercall or ioctl-driven interrupt-controller operation.\nS:C - The vulnerable component is host KVM, and a malicious guest or KVM user can affect host kernel memory, crossing the VM isolation boundary.\nC:H - The bug is an out-of-bounds access to the host kernel `phys_map` array, and under the required higher-severity rule this is treated as potentially exposing host kernel memory during exploitation.\nI:H - If the out-of-bounds entry is interpreted as an enabled vCPU, later interrupt-injection paths dereference and modify state through a bogus `struct kvm_vcpu` pointer, making host kernel memory corruption defensible.\nA:H - The reported failure includes UBSAN out-of-bounds warnings in host KVM, and attacker-controlled negative indices can reasonably cause host kernel oops, panic, or repeated denial of service."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:23:30.748Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.12.80"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.18.21"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.19.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}