[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1 of 4] ept p2m: set rwx flags to 0 for invalid and mmio_dm types



# HG changeset patch
# User Patrick Colp <Patrick.Colp@xxxxxxxxxx>
# Date 1249480778 -3600
# Node ID 86486ebbb5f0bd4f94b42492b7e00110971a4078
# Parent  68e8b8379244e293c55875e7dc3692fc81d3d212
ept p2m: set rwx flags to 0 for invalid and mmio_dm types.

Read/write/execute flags are set to 1 before calling the type_to_flags
function which sets them to their appropriate values depending on the p2m
type. However, in invalid, mmio_dm, and default/unknown cases in type_to_flags
just falls through, unsafely leaving full access to these pages.

Signed-off-by: Patrick Colp <Patrick.Colp@xxxxxxxxxx>

diff -r 68e8b8379244 -r 86486ebbb5f0 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Sun Aug 02 13:43:15 2009 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Wed Aug 05 14:59:38 2009 +0100
@@ -36,6 +36,7 @@
         case p2m_invalid:
         case p2m_mmio_dm:
         default:
+             entry->r = entry->w = entry->x = 0;
             return;
         case p2m_ram_rw:
         case p2m_mmio_direct:
@@ -196,7 +197,6 @@
             ept_entry->rsvd = 0;
             ept_entry->avail2 = 0;
             /* last step */
-            ept_entry->r = ept_entry->w = ept_entry->x = 1;
             ept_p2m_type_to_flags(ept_entry, p2mt);
         }
         else
@@ -242,7 +242,6 @@
             split_ept_entry->rsvd = 0;
             split_ept_entry->avail2 = 0;
             /* last step */
-            split_ept_entry->r = split_ept_entry->w = split_ept_entry->x = 1;
             ept_p2m_type_to_flags(split_ept_entry, split_p2mt);
         }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.