LiveActive security incident?Get immediate response
CVE Record

CVE-2022-50257: xen/gntdev: Prevent leaking grants

In the Linux kernel, the following vulnerability has been resolved: xen/gntdev: Prevent leaking grants Prior to this commit, if a grant mapping operation failed partially, some of the entries in the map_ops array would be invalid, whereas all of the entries in the kmap_ops array would be valid. This in turn would cause the following logic in gntdev_map_grant_pages to become invalid: for (i = 0; i < map->count; i++) { if (map->map_ops[i].status == GNTST_okay) { map->unmap_ops[i].handle = map->map_ops[i].handle; if (!use_ptemod) alloced++; } if (use_ptemod) { if (map->kmap_ops[i].status == GNTST_okay) { if (map->map_ops[i].status == GNTST_okay) alloced++; map->kunmap_ops[i].handle = map->kmap_ops[i].handle; } } } ... atomic_add(alloced, &map->live_grants); Assume that use_ptemod is true (i.e., the domain mapping the granted pages is a paravirtualized domain). In the code excerpt above, note that the "alloced" variable is only incremented when both kmap_ops[i].status and map_ops[i].status are set to GNTST_okay (i.e., both mapping operations are successful). However, as also noted above, there are cases where a grant mapping operation fails partially, breaking the assumption of the code excerpt above. The aforementioned causes map->live_grants to be incorrectly set. In some cases, all of the map_ops mappings fail, but all of the kmap_ops mappings succeed, meaning that live_grants may remain zero. This in turn makes it impossible to unmap the successfully grant-mapped pages pointed to by kmap_ops, because unmap_grant_pages has the following snippet of code at its beginning: if (atomic_read(&map->live_grants) == 0) return; /* Nothing to do */ In other cases where only some of the map_ops mappings fail but all kmap_ops mappings succeed, live_grants is made positive, but when the user requests unmapping the grant-mapped pages, __unmap_grant_pages_done will then make map->live_grants negative, because the latter function does not check if all of the pages that were requested to be unmapped were actually unmapped, and the same function unconditionally subtracts "data->count" (i.e., a value that can be greater than map->live_grants) from map->live_grants. The side effects of a negative live_grants value have not been studied. The net effect of all of this is that grant references are leaked in one of the above conditions. In Qubes OS v4.1 (which uses Xen's grant mechanism extensively for X11 GUI isolation), this issue manifests itself with warning messages like the following to be printed out by the Linux kernel in the VM that had granted pages (that contain X11 GUI window data) to dom0: "g.e. 0x1234 still pending", especially after the user rapidly resizes GUI VM windows (causing some grant-mapping operations to partially or completely fail, due to the fact that the VM unshares some of the pages as part of the window resizing, making the pages impossible to grant-map from dom0). The fix for this issue involves counting all successful map_ops and kmap_ops mappings separately, and then adding the sum to live_grants. During unmapping, only the number of successfully unmapped grants is subtracted from live_grants. The code is also modified to check for negative live_grants values after the subtraction and warn the user.

UnknownCVSS not scoredNot KEV-listedUpdated
Glexia's TakeAutomated analysisunknown

Security readout for executives and security teams

Plain-English summary

This is a Linux Xen grant-accounting bug. In certain paravirtualized VM mappings, partial failures can leave shared memory grants tracked incorrectly, causing leaked grant references. The source describes Qubes OS warning messages during rapid GUI resizing, but does not establish data exposure or service compromise.

Executive priority

Treat as targeted maintenance for Xen-based virtualization, not a confirmed internet-scale emergency. Patch through normal kernel channels, with higher priority for Qubes or Xen environments that rely heavily on grant sharing and show kernel warnings.

Technical view

In xen/gntdev, map_ops and kmap_ops can diverge after partial grant mapping failure. The old live_grants accounting only counted entries where both succeeded, so successful kernel mappings could be left untracked or later drive the counter negative. The fix separately counts successful mappings and only subtracts successfully unmapped grants.

Likely exposure

Most relevant to Linux systems running Xen paravirtualized domains using gntdev grant mappings. The bundle lists Linux kernels including 5.19 through 6.1 and stable branches such as 4.9.332, 4.14.298, 4.19.264, 5.4.223, 5.10.153, and 5.15.75 as affected.

Exploitation context

The bundle does not cite active exploitation, public exploit code, or KEV listing. The described trigger is operational: partial Xen grant mapping failure, with Qubes OS 4.1 kernel warnings after rapid GUI window resizing. The security impact beyond leaked grant references and possible negative counters is not fully studied in the source.

Researcher notes

The source records root cause and fix but omits CVSS, CWE, exploitability, and studied impact of negative live_grants. Analysis should stay scoped to grant-reference leaks in Xen gntdev on paravirtualized domains unless additional vendor advisories add evidence.

Mitigation direction

  • Apply the relevant Linux stable kernel fix from your vendor or distribution.
  • Prioritize Xen hosts and guest images that run paravirtualized domains using gntdev.
  • Check Qubes OS and Linux distribution advisories for packaged kernel updates.
  • If patching is delayed, monitor for repeated grant-leak kernel warnings.
  • Do not assume non-Xen systems are affected without matching kernel configuration evidence.

Validation and detection

  • Inventory Linux kernels on Xen paravirtualized guests and dom0 components using gntdev.
  • Compare running kernel versions against the affected versions and fixed stable commits.
  • Review kernel logs for grant-related warnings such as still-pending grant entries.
  • Confirm the live_grants accounting fix is present in downstream kernel source or changelog.
  • Retest Qubes or Xen GUI resize workflows after patching if they triggered warnings.
Prepared
Confidence
medium
Sources
11

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cve · low confidence lookup

CVE-2022-50257 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Unknown
CVSS
Not scored
Known Exploited
No
Published
Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

0CVSS vectors
3Timeline events
0ADP providers
10Source links

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LinuxLinux36cd49b071fceca70326d9db786aa15e9fffd677, 2fe26a9a70482bea7827803fdec98050fec68b20, 73e9e72247b98da65bc32d41a961e820cca5f503, ee25841221c17228cbd30262a90f3b03ad80cdf6, 79963021fd718b74bed4cbc98f5f49d3ba6fb48c, 87a54feba68f5e47925c8e49100db9b2a8add761, dbe97cff7dd9f0f75c524afdd55ad46be3d15295, dbe97cff7dd9f0f75c524afdd55ad46be3d15295, dbe97cff7dd9f0f75c524afdd55ad46be3d15295, d4a49d20cd7cdb6bd075cd04c2cd00a7eba907edunaffected
LinuxLinux5.19, 0, 4.9.332, 4.14.298, 4.19.264, 5.4.223, 5.10.153, 5.15.75, 5.19.17, 6.0.3, 6.1affected
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.