x86/mm: disallow page stealing from HVM domains
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:15:54 +0000 (13:15 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 7 Sep 2017 18:17:58 +0000 (19:17 +0100)
commitab6ff8a970d1d590513a14ca0ec7f28768ae2385
treecc575c800e73a797ab4a189480c755b422cb243f
parent97b5c2fde919ef084708c9b4f9cba43250ef80ee
x86/mm: disallow page stealing from HVM domains

The operation's success can't be controlled by the guest, as the device
model may have an active mapping of the page. If we nevertheless
permitted this operation, we'd have to add further TLB flushing to
prevent scenarios like

"Domains A (HVM), B (PV), C (PV); B->target==A
 Steps:
 1. B maps page X from A as writable
 2. B unmaps page X without a TLB flush
 3. A sends page X to C via GNTTABOP_transfer
 4. C maps page X as pagetable (potentially causing a TLB flush in C,
 but not in B)

 At this point, X would be mapped as a pagetable in C while being
 writable through a stale TLB entry in B."

A similar scenario could be constructed for A using XENMEM_exchange and
some arbitrary PV domain C then having this page allocated.

This is XSA-217.

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Gbp-Pq: Name x86mm-disallow-page-stealing-from-hvm-do
xen/arch/x86/mm.c