CVE-2025-40065
RISC-V: KVM: Write hgatp register with valid mode bits
Mitigation
- Upgrade Linux to 2b351e3d04be9e1533f26c3464f1e44a5beace30 or later.
Who should check
- Anyone running Linux >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 5cba8ae00279296a586d0596443109d601b1d116; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 2b351e3d04be9e1533f26c3464f1e44a5beace30
- Anyone running Linux 5.16
Vulnerability facts
- Affected
- Linux >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 5cba8ae00279296a586d0596443109d601b1d116; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 2b351e3d04be9e1533f26c3464f1e44a5beace30; Linux 5.16
- Fixed in
- Linux 8b6e327736db013b9e385c3f6f9f0b04ddf26e43, Linux 5cba8ae00279296a586d0596443109d601b1d116, Linux 2b351e3d04be9e1533f26c3464f1e44a5beace30
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Unknown
- CVSS
- Not scored yet
- EPSS
- 0.28% chance of exploitation in 30 days (percentile 13, 2026-11-26)
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 5cba8ae00279296a586d0596443109d601b1d116; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 2b351e3d04be9e1533f26c3464f1e44a5beace30 | — | cvelist |
| Linux | 5.16 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-40065. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-40065.md Affected: Linux >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 5cba8ae00279296a586d0596443109d601b1d116; >= fd7bb4a251dfc1da3496bf5… Fixed in: Linux 8b6e327736db013b9e385c3f6f9f0b04ddf26e43, Linux 5cba8ae00279296a586d0596443109d601b1d116, Linux 2b351e3d04be9e1533f26c3464f1e44a5beace30 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Other
- https://git.kernel.org/stable/c/feb64ca53d97b3ac8ba9ecbeae5f9426f1513650
- https://git.kernel.org/stable/c/8b6e327736db013b9e385c3f6f9f0b04ddf26e43
- https://git.kernel.org/stable/c/5cba8ae00279296a586d0596443109d601b1d116
- https://git.kernel.org/stable/c/d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357
- https://git.kernel.org/stable/c/2b351e3d04be9e1533f26c3464f1e44a5beace30
FAQ
Is CVE-2025-40065 being exploited?
There is no confirmed exploitation: CVE-2025-40065 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-40065?
It has no CVSS score yet. Unknown.
Which versions are affected by CVE-2025-40065?
Linux >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 5cba8ae00279296a586d0596443109d601b1d116; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357; >= fd7bb4a251dfc1da3496bf59a4793937c13e8c1f, < 2b351e3d04be9e1533f26c3464f1e44a5beace30; Linux 5.16.
Is there a fix for CVE-2025-40065?
Yes. Fixed in Linux 8b6e327736db013b9e385c3f6f9f0b04ddf26e43, Linux 5cba8ae00279296a586d0596443109d601b1d116, Linux 2b351e3d04be9e1533f26c3464f1e44a5beace30. Upgrade Linux to 2b351e3d04be9e1533f26c3464f1e44a5beace30 or later.
How do I check if I'm affected by CVE-2025-40065?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.