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] Shadow mode's writable-PTs should only allow guest kerne

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Shadow mode's writable-PTs should only allow guest kernels access to PTs
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Jul 2005 13:46:09 -0400
Delivery-date: Wed, 20 Jul 2005 17:46:34 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 maf46@xxxxxxxxxxxxxxxxx
# Node ID 390e4d63cdb1de2a86c60cecdc4f82c5d69f3aca
# Parent  43564304cf9448ad8978df6d2d0d6721b4615143

Shadow mode's writable-PTs should only allow guest kernels access to PTs

diff -r 43564304cf94 -r 390e4d63cdb1 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Mon Jul 18 20:22:11 2005
+++ b/xen/arch/x86/shadow32.c   Tue Jul 19 10:40:26 2005
@@ -2612,7 +2612,7 @@
 
         if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_RW)) )
         {
-            if ( shadow_mode_page_writable(d, l1e_get_pfn(gpte)) )
+            if ( shadow_mode_page_writable(va, regs, l1e_get_pfn(gpte)) )
             {
                 allow_writes = 1;
                 l1e_add_flags(gpte, _PAGE_RW);
diff -r 43564304cf94 -r 390e4d63cdb1 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Mon Jul 18 20:22:11 2005
+++ b/xen/arch/x86/shadow.c     Tue Jul 19 10:40:26 2005
@@ -1684,7 +1684,7 @@
 
         if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_RW)) )
         {
-            if ( shadow_mode_page_writable(d, l1e_get_pfn(gpte)) )
+            if ( shadow_mode_page_writable(va, regs, l1e_get_pfn(gpte)) )
             {
                 allow_writes = 1;
                 l1e_add_flags(gpte, _PAGE_RW);
diff -r 43564304cf94 -r 390e4d63cdb1 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Mon Jul 18 20:22:11 2005
+++ b/xen/include/asm-x86/shadow.h      Tue Jul 19 10:40:26 2005
@@ -1691,8 +1691,10 @@
 /************************************************************************/
 
 static inline int
-shadow_mode_page_writable(struct domain *d, unsigned long gpfn)
-{
+shadow_mode_page_writable(unsigned long va, struct cpu_user_regs *regs, 
unsigned long gpfn)
+{
+    struct vcpu *v = current;
+    struct domain *d = v->domain;
     unsigned long mfn = __gpfn_to_mfn(d, gpfn);
     u32 type = frame_table[mfn].u.inuse.type_info & PGT_type_mask;
 
@@ -1701,11 +1703,14 @@
         type = shadow_max_pgtable_type(d, gpfn, NULL);
 
     if ( VM_ASSIST(d, VMASST_TYPE_writable_pagetables) &&
-         (type == PGT_l1_page_table) )
+         (type == PGT_l1_page_table) &&
+         (va < HYPERVISOR_VIRT_START) &&
+         KERNEL_MODE(v, regs) )
         return 1;
 
     if ( shadow_mode_write_all(d) &&
-         type && (type <= PGT_l4_page_table) )
+         type && (type <= PGT_l4_page_table) &&
+         KERNEL_MODE(v, regs) )
         return 1;
 
     return 0;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Shadow mode's writable-PTs should only allow guest kernels access to PTs, Xen patchbot -unstable <=