CVE-2022-50471
Description
A logic error was found in the Linux kernel's Xen grant device driver in the VMA (Virtual Memory Area) splitting and grant mapping management. A local user in a Xen paravirtualized domain can trigger this issue by performing split munmap operations on grant mappings or remapping with MAP_FIXED, causing incorrect tracking of VMA boundaries and improper cleanup of grant references. This results in bad page mappings, general protection faults in the Xen hypervisor, and denial of service through domain crashes.
Statement
The gntdev driver manages memory mappings of pages granted by other Xen domains. The code maintained a single VMA pointer per grant mapping, but Linux can split VMAs when users partially unmap regions. When a mapping spanning two pages is split by unmapping one page, the driver loses track of the relationship between VMAs and grants. Additionally, the driver allowed remapping the same address range with MAP_FIXED, creating a scenario where grants are unmapped while marked as "being_removed," then remapped, then unmapped again—triggering Xen's protection against implicit unmapping of granted pages. The fix removes dependence on VMA tracking, uses atomic guards to prevent mapping reuse, and defers MMU notifier removal until all associated VMAs are closed. Triggering requires running as a Xen PV domain guest with the ability to manipulate gntdev mappings.
Mitigation
To mitigate this issue, prevent the xen_gntdev module from being loaded. See https://access.redhat.com/solutions/41278 for instructions on blacklisting kernel modules.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 5.5 | 5.5 | N/A |
| Attack Vector | Local | Local | N/A |
| Attack Complexity | Low | Low | N/A |
| Privileges Required | Low | Low | N/A |
| User Interaction | None | None | N/A |
| Scope | Unchanged | Unchanged | N/A |
| Confidentiality | None | None | N/A |
| Integrity Impact | None | None | N/A |
| Availability Impact | High | High | N/A |
Vector
Red Hat: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Understanding the Weakness (CWE)
Availability
Technical Impact: DoS: Resource Consumption (Memory); DoS: Resource Consumption (Other)
An adversary that can cause a resource counter to become inaccurate may be able to create situations where resources are not accounted for and not released, thus causing resources to become scarce for future needs.
Availability
Technical Impact: DoS: Crash, Exit, or Restart
An adversary that can cause a resource counter to become inaccurate may be able to force an error that causes the product to crash or exit out of its current operation.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.