WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1 of 4] ept p2m: set rwx flags to 0 for invalid and mmio_dm types
From: Patrick Colp <Patrick.Colp@xxxxxxxxxx>
Date: Wed, 5 Aug 2009 15:00:47 +0100
Delivery-date: Wed, 05 Aug 2009 07:02:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1249480846@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1249480846@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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