VYPR
Unrated severityNVD Advisory· Published Oct 28, 2025· Updated Apr 15, 2026

CVE-2025-40065

CVE-2025-40065

Description

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

RISC-V: KVM: Write hgatp register with valid mode bits

According to the RISC-V Privileged Architecture Spec, when MODE=Bare is selected,software must write zero to the remaining fields of hgatp.

We have detected the valid mode supported by the HW before, So using a valid mode to detect how many vmid bits are supported.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

In the Linux kernel, a RISC-V KVM bug incorrectly sets hgatp register fields when MODE=Bare, risking undefined behavior and VMID detection errors.

Vulnerability

In the Linux kernel, RISC-V KVM implementation mishandles the hgatp register when the MODE field is set to Bare. According to the RISC-V Privileged Architecture Specification, when MODE=Bare, software must write zero to all remaining fields of hgatp. The code failed to enforce this requirement, potentially leaving stale or incorrect bits in the register.

Exploitation

This vulnerability is accessible to attackers with low privileges required and local access, as it involves guest VM operations that may cause the KVM hypervisor to program hgatp incorrectly. The attacker would need the ability to influence the VMID allocation or register configuration, though specific prerequisites are not detailed.

Impact

Improper handling of hgatp could lead to incorrect VMID bit detection and allocation. This might compromise isolation between virtual machines, potentially allowing a malicious guest to affect other guests or the host. The exact security consequences are not fully specified, but the deviation from the spec indicates a potential for hardware-software misbehavior.

Mitigation

The fix is incorporated in the stable kernel tree as a commit addressing this issue. Users should update to a kernel version containing this patch to ensure correct hgatp register programming and avoid undefined behavior.

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

2

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.