# CVE-2022-49882: KVM: Reject attempts to consume or refresh inactive gfn\_to\_pfn\_cache

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-05-01T14:10:29.213Z
- **Modified:** 2026-10-15T22:17:25.363Z

## Who should check

- Anyone running Linux \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< bfa9672f8fc9eb118124bab61899d2dd497f95ba; \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< ecbcf030b45666ad11bc98565e71dfbcb7be4393
- Anyone running Linux 5.17

## Description

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

KVM: Reject attempts to consume or refresh inactive gfn\_to\_pfn\_cache

Reject kvm\_gpc\_check() and kvm\_gpc\_refresh() if the cache is inactive.
Not checking the active flag during refresh is particularly egregious, as
KVM can end up with a valid, inactive cache, which can lead to a variety
of use-after-free bugs, e.g. consuming a NULL kernel pointer or missing
an mmu\_notifier invalidation due to the cache not being on the list of
gfns to invalidate.

Note, "active" needs to be set if and only if the cache is on the list
of caches, i.e. is reachable via mmu\_notifier events.  If a relevant
mmu\_notifier event occurs while the cache is "active" but not on the
list, KVM will not acquire the cache's lock and so will not serailize
the mmu\_notifier event with active users and/or kvm\_gpc\_refresh().

A race between KVM\_XEN\_ATTR\_TYPE\_SHARED\_INFO and KVM\_XEN\_HVM\_EVTCHN\_SEND
can be exploited to trigger the bug.

1. Deactivate shinfo cache:

kvm\_xen\_hvm\_set\_attr
case KVM\_XEN\_ATTR\_TYPE\_SHARED\_INFO
 kvm\_gpc\_deactivate
  kvm\_gpc\_unmap
   gpc-\>valid = false
   gpc-\>khva = NULL
  gpc-\>active = false

Result: active = false, valid = false

2. Cause cache refresh:

kvm\_arch\_vm\_ioctl
case KVM\_XEN\_HVM\_EVTCHN\_SEND
 kvm\_xen\_hvm\_evtchn\_send
  kvm\_xen\_set\_evtchn
   kvm\_xen\_set\_evtchn\_fast
    kvm\_gpc\_check
    return -EWOULDBLOCK because !gpc-\>valid
   kvm\_xen\_set\_evtchn\_fast
    return -EWOULDBLOCK
   kvm\_gpc\_refresh
    hva\_to\_pfn\_retry
     gpc-\>valid = true
     gpc-\>khva = not NULL

Result: active = false, valid = true

3. Race ioctl KVM\_XEN\_HVM\_EVTCHN\_SEND against ioctl
KVM\_XEN\_ATTR\_TYPE\_SHARED\_INFO:

kvm\_arch\_vm\_ioctl
case KVM\_XEN\_HVM\_EVTCHN\_SEND
 kvm\_xen\_hvm\_evtchn\_send
  kvm\_xen\_set\_evtchn
   kvm\_xen\_set\_evtchn\_fast
    read\_lock gpc-\>lock
                                          kvm\_xen\_hvm\_set\_attr case
                                          KVM\_XEN\_ATTR\_TYPE\_SHARED\_INFO
                                           mutex\_lock kvm-\>lock
                                           kvm\_xen\_shared\_info\_init
                                            kvm\_gpc\_activate
                                             gpc-\>khva = NULL
    kvm\_gpc\_check
     \[ Check passes because gpc-\>valid is
       still true, even though gpc-\>khva
       is already NULL. \]
    shinfo = gpc-\>khva
    pending\_bits = shinfo-\>evtchn\_pending
    CRASH: test\_and\_set\_bit(..., pending\_bits)

## Affected and fixed versions

- Linux: \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< bfa9672f8fc9eb118124bab61899d2dd497f95ba; \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< ecbcf030b45666ad11bc98565e71dfbcb7be4393 (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49882. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49882.md
Affected: Linux >= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, < bfa9672f8fc9eb118124bab61899d2dd497f95ba; >= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, < ecbcf030b45666ad11bc98565e71dfbcb7be4393; Linux 5.17
Fixed in: no fixed version listed yet

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.
```

## FAQ

### Is CVE-2022-49882 being exploited?

There is no confirmed exploitation: CVE-2022-49882 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-2022-49882?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49882?

Linux \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< bfa9672f8fc9eb118124bab61899d2dd497f95ba; \>= 982ed0de4753ed6e71dbd40f82a5a066baf133ed, \< ecbcf030b45666ad11bc98565e71dfbcb7be4393; Linux 5.17.

### Is there a fix for CVE-2022-49882?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49882?

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.

## References

- patch: <https://git.kernel.org/stable/c/bfa9672f8fc9eb118124bab61899d2dd497f95ba>
- patch: <https://git.kernel.org/stable/c/ecbcf030b45666ad11bc98565e71dfbcb7be4393>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49882>

HTML: <https://flawdb.com/CVE-2022-49882> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49882>
