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-changelog

[Xen-changelog] [xen-3.3-testing] ept p2m: set rwx flags to 0 for invali

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.3-testing] ept p2m: set rwx flags to 0 for invalid and mmio_dm types.
From: "Xen patchbot-3.3-testing" <patchbot-3.3-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Aug 2009 05:35:43 -0700
Delivery-date: Thu, 06 Aug 2009 05:38:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1249549813 -3600
# Node ID 3369be147faf6105705d273d5f8bb359f83ff80e
# Parent  296697be5bfbe094fccee383140c113b43129ce7
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>
xen-unstable changeset:   20026:1e436b3752b4
xen-unstable date:        Thu Aug 06 09:14:52 2009 +0100
---
 xen/arch/x86/mm/hap/p2m-ept.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r 296697be5bfb -r 3369be147faf xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Tue Aug 04 16:32:14 2009 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Thu Aug 06 10:10:13 2009 +0100
@@ -36,15 +36,16 @@ static void ept_p2m_type_to_flags(ept_en
         case p2m_invalid:
         case p2m_mmio_dm:
         default:
+            entry->r = entry->w = entry->x = 0;
             return;
         case p2m_ram_rw:
         case p2m_mmio_direct:
-             entry->r = entry->w = entry->x = 1;
+            entry->r = entry->w = entry->x = 1;
             return;
         case p2m_ram_logdirty:
         case p2m_ram_ro:
-             entry->r = entry->x = 1;
-             entry->w = 0;
+            entry->r = entry->x = 1;
+            entry->w = 0;
             return;
     }
 }
@@ -175,7 +176,6 @@ ept_set_entry(struct domain *d, unsigned
             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
@@ -218,7 +218,6 @@ ept_set_entry(struct domain *d, unsigned
             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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.3-testing] ept p2m: set rwx flags to 0 for invalid and mmio_dm types., Xen patchbot-3.3-testing <=