x86: don't allow page table updates on non-PV page tables in do_mmu_update()
authorJan Beulich <jbeulich@suse.com>
Tue, 18 Nov 2014 13:15:21 +0000 (14:15 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 18 Nov 2014 13:15:21 +0000 (14:15 +0100)
paging_write_guest_entry() and paging_cmpxchg_guest_entry() aren't
consistently supported for non-PV guests (they'd deref NULL for PVH or
non-HAP HVM ones). Don't allow respective MMU_* operations on the
page tables of such domains.

This is CVE-2014-8594 / XSA-109.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm.c

index edd1923b1ccab1c10849952ed4a2d3a24f6b478d..8ee993806139bb0df3373da3a06dca33f8639a7b 100644 (file)
@@ -3493,6 +3493,10 @@ long do_mmu_update(
         {
             p2m_type_t p2mt;
 
+            rc = -EOPNOTSUPP;
+            if ( unlikely(paging_mode_refcounts(pt_owner)) )
+                break;
+
             xsm_needed |= XSM_MMU_NORMAL_UPDATE;
             if ( get_pte_flags(req.val) & _PAGE_PRESENT )
             {