]> xenbits.xensource.com Git - xen.git/commitdiff
x86: don't ignore foreigndom on L2/L3/L4 page table updates
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2017 16:23:53 +0000 (17:23 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2017 16:23:53 +0000 (17:23 +0100)
Silently assuming DOMID_SELF is unlikely to be a good idea for page
table updates. For PGT_writable pages, though, it seems better to allow
the writes, so the same check isn't being applied there.

Also add blank lines between the individual case blocks.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index 3c84ae87c129704db671bfe2844a53721b5e976b..e919956919edcd8b795666286b32aef527067ebf 100644 (file)
@@ -3662,18 +3662,28 @@ long do_mmu_update(
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v,
                                       pg_owner);
                     break;
+
                 case PGT_l2_page_table:
+                    if ( unlikely(pg_owner != pt_owner) )
+                        break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
+
                 case PGT_l3_page_table:
+                    if ( unlikely(pg_owner != pt_owner) )
+                        break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
+
                 case PGT_l4_page_table:
+                    if ( unlikely(pg_owner != pt_owner) )
+                        break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     break;
+
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
                     if ( paging_write_guest_entry(v, va, req.val, _mfn(mfn)) )