]> xenbits.xensource.com Git - xen.git/commit
x86/mm: don't wrongly set page ownership
authorJan Beulich <jbeulich@suse.com>
Tue, 12 Dec 2017 13:28:36 +0000 (14:28 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Dec 2017 13:28:36 +0000 (14:28 +0100)
commitff2a793e15bb0b6254bc849ef8e83e1c284c3583
tree61352e064e499c9f58ce1f3800b1fe3ae181af1b
parente40b0219a8c77741ae48989efb520f4a762a5be3
x86/mm: don't wrongly set page ownership

PV domains can obtain mappings of any pages owned by the correct domain,
including ones that aren't actually assigned as "normal" RAM, but used
by Xen internally.  At the moment such "internal" pages marked as owned
by a guest include pages used to track logdirty bits, as well as p2m
pages and the "unpaged pagetable" for HVM guests. Since the PV memory
management and shadow code conflict in their use of struct page_info
fields, and since shadow code is being used for log-dirty handling for
PV domains, pages coming from the shadow pool must, for PV domains, not
have the domain set as their owner.

While the change could be done conditionally for just the PV case in
shadow code, do it unconditionally (and for consistency also for HAP),
just to be on the safe side.

There's one special case though for shadow code: The page table used for
running a HVM guest in unpaged mode is subject to get_page() (in
set_shadow_status()) and hence must have its owner set.

This is XSA-248.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/common.c