In the Linux kernel, the following vulnerability has been resolved: KVM: guest_memfd: Remove bindings on memslot deletion when gmem is dying When… (CVE-2025-40274)
A use-after-free vulnerability in the Linux kernel's KVM guest_memfd component was resolved. The issue occurs when unbinding a memslot from a guest_memfd instance while the guest_memfd file is in the process of being released, leading to a write operation on freed memory. This was detected by KASAN as a slab-use-after-free bug. The vulnerability could allow an attacker with local privileges to cause memory corruption with high impact on confidentiality, integrity, and availability.
AI Analysis
Technical Summary
The vulnerability (CVE-2025-40274) in the Linux kernel's KVM subsystem involves improper handling of memslot bindings during memslot deletion when the guest_memfd file reference count has dropped to zero (file is dying). Specifically, the bindings were not removed correctly, causing kvm_gmem_release() to write to freed memory, resulting in a use-after-free condition. This was identified by KASAN instrumentation. The root cause is that the lifecycle of the file mapping is outside KVM's control, and the code did not properly handle the memslot unbinding in this edge case. The fix involves removing bindings even if the guest_memfd file is dying to prevent use-after-free.
Potential Impact
This vulnerability allows local attackers with the ability to manipulate KVM guest memory regions to trigger a use-after-free condition, potentially leading to memory corruption. The CVSS vector indicates high impact on confidentiality, integrity, and availability. Exploitation could result in privilege escalation or denial of service within the affected Linux kernel environment.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since no explicit patch or official fix link is provided, users should monitor Linux kernel updates and apply relevant patches once available. Until then, avoid untrusted manipulation of KVM guest memory regions involving guest_memfd. No vendor advisory states 'no action required' or 'already mitigated'.
In the Linux kernel, the following vulnerability has been resolved: KVM: guest_memfd: Remove bindings on memslot deletion when gmem is dying When… (CVE-2025-40274)
Description
A use-after-free vulnerability in the Linux kernel's KVM guest_memfd component was resolved. The issue occurs when unbinding a memslot from a guest_memfd instance while the guest_memfd file is in the process of being released, leading to a write operation on freed memory. This was detected by KASAN as a slab-use-after-free bug. The vulnerability could allow an attacker with local privileges to cause memory corruption with high impact on confidentiality, integrity, and availability.
CVSS v3.1
Score 7.8high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2025-40274) in the Linux kernel's KVM subsystem involves improper handling of memslot bindings during memslot deletion when the guest_memfd file reference count has dropped to zero (file is dying). Specifically, the bindings were not removed correctly, causing kvm_gmem_release() to write to freed memory, resulting in a use-after-free condition. This was identified by KASAN instrumentation. The root cause is that the lifecycle of the file mapping is outside KVM's control, and the code did not properly handle the memslot unbinding in this edge case. The fix involves removing bindings even if the guest_memfd file is dying to prevent use-after-free.
Potential Impact
This vulnerability allows local attackers with the ability to manipulate KVM guest memory regions to trigger a use-after-free condition, potentially leading to memory corruption. The CVSS vector indicates high impact on confidentiality, integrity, and availability. Exploitation could result in privilege escalation or denial of service within the affected Linux kernel environment.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since no explicit patch or official fix link is provided, users should monitor Linux kernel updates and apply relevant patches once available. Until then, avoid untrusted manipulation of KVM guest memory regions involving guest_memfd. No vendor advisory states 'no action required' or 'already mitigated'.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-h3qw-rx4w-h8fj
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40274"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d59c2644c7f847990f
Added to database: 07/30/2026, 15:50:45 UTC
Last enriched: 07/30/2026, 17:38:25 UTC
Last updated: 09/10/2026, 19:26:50 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.