The shadow pagetable code uses linear mappings to inspect and modify the
shadow pagetables. A linear mapping which points back to itself is known as
self-linear. For translated guests, the shadow linear mappings (being in a
separate address space) are not intended to be self-linear. For
non-translated guests, the shadow linear mappings (being the same
address space) are intended to be self-linear.
When constructing a monitor pagetable for Xen to run on a vcpu with, the shadow
linear slot is filled with a self-linear mapping, and for translated guests,
shortly thereafter replaced with a non-self-linear mapping, when the guest's
%cr3 is shadowed.
However when writeable heuristics are used, the shadow mappings are used as
part of shadowing %cr3, causing the heuristics to be applied to Xen's
pagetables, not the guest shadow pagetables.
While investigating, it was also identified that PV auto-translate mode was
insecure. This mode was removed in Xen 4.7 due to being unused, unmaintained
and presumed broken. We are not aware of any guest implementation of PV
A malicious or buggy HVM guest may cause a hypervisor crash, resulting in a
Denial of Service (DoS) affecting the entire host, or cause hypervisor memory
corruption. We cannot rule out a guest being able to escalate its privilege.
All versions of Xen are vulnerable.
HVM guests using shadow mode paging can exploit this vulnerability.
HVM guests using Hardware Assisted Paging (HAP) as well as PV guests
cannot exploit this vulnerability. guests cannot exploit the
ARM systems are not vulnerable.
Running only PV guests will avoid this vulnerability.
Where the HVM guest is explicitly configured to use shadow paging (eg
via the `hap=0' xl domain configuration file parameter), changing to
HAP (eg by setting `hap=1') will avoid exposing the vulnerability to
those guests. HAP is the default (in upstream Xen), where the
hardware supports it; so this mitigation is only applicable if HAP has
been disabled by configuration.
Created xen tracking bugs for this issue:
Affects: fedora-all [bug 1501391]
Name: the Xen project
Upstream: Andrew Cooper (Citrix)