bf4ddc0
x86: don't allow page table updates on non-PV page tables in do_mmu_update()
bf4ddc0
bf4ddc0
paging_write_guest_entry() and paging_cmpxchg_guest_entry() aren't
bf4ddc0
consistently supported for non-PV guests (they'd deref NULL for PVH or
bf4ddc0
non-HAP HVM ones). Don't allow respective MMU_* operations on the
bf4ddc0
page tables of such domains.
bf4ddc0
bf4ddc0
This is XSA-109.
bf4ddc0
bf4ddc0
Signed-off-by: Jan Beulich <jbeulich@suse.com>
bf4ddc0
Acked-by: Tim Deegan <tim@xen.org>
bf4ddc0
bf4ddc0
--- a/xen/arch/x86/mm.c
bf4ddc0
+++ b/xen/arch/x86/mm.c
bf4ddc0
@@ -3800,6 +3800,10 @@ long do_mmu_update(
bf4ddc0
         {
bf4ddc0
             p2m_type_t p2mt;
bf4ddc0
 
bf4ddc0
+            rc = -EOPNOTSUPP;
bf4ddc0
+            if ( unlikely(paging_mode_refcounts(pt_owner)) )
bf4ddc0
+                break;
bf4ddc0
+
bf4ddc0
             rc = xsm_mmu_normal_update(d, pt_owner, pg_owner, req.val);
bf4ddc0
             if ( rc )
bf4ddc0
                 break;