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-4.0-testing] x86: tighten filter on ptwr_do_page_fa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] x86: tighten filter on ptwr_do_page_fault()
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Nov 2010 20:20:15 -0800
Delivery-date: Tue, 30 Nov 2010 20:20:35 -0800
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@xxxxxxx>
# Date 1291042003 0
# Node ID 465c81b077009ba3cb986caef2676c086718d71c
# Parent  2901cbe2eccc41ebd552bf6c829c8f0c46ba396c
x86: tighten filter on ptwr_do_page_fault()

Even not-so-recent Linux may, due to post-2.6.18 changes to the
process creation code, cause quite a number (depending on environment
and argument size) of faulting accesses to user space originating from
kernel mode. Generally those happen for non-present pages and would
lead to a nested page fault from guest_get_eff_l1e(). They can be
avoided by checking for PFEC_page_present as long as the guest isn't
running on shadow page tables.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   22449:3afb5ecbf69f
xen-unstable date:        Mon Nov 29 14:40:55 2010 +0000
---
 xen/arch/x86/traps.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff -r 2901cbe2eccc -r 465c81b07700 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Nov 29 14:46:01 2010 +0000
+++ b/xen/arch/x86/traps.c      Mon Nov 29 14:46:43 2010 +0000
@@ -1237,13 +1237,20 @@ static int fixup_page_fault(unsigned lon
     }
 
     if ( VM_ASSIST(d, VMASST_TYPE_writable_pagetables) &&
-         guest_kernel_mode(v, regs) &&
-         /* Do not check if access-protection fault since the page may 
-            legitimately be not present in shadow page tables */
-         ((regs->error_code & (PFEC_write_access|PFEC_reserved_bit)) ==
-          PFEC_write_access) &&
-         ptwr_do_page_fault(v, addr, regs) )
-        return EXCRET_fault_fixed;
+         guest_kernel_mode(v, regs) )
+    {
+        unsigned int mbs = PFEC_write_access;
+        unsigned int mbz = PFEC_reserved_bit | PFEC_insn_fetch;
+
+        /* Do not check if access-protection fault since the page may 
+           legitimately be not present in shadow page tables */
+        if ( !paging_mode_enabled(d) )
+            mbs |= PFEC_page_present;
+
+        if ( ((regs->error_code & (mbs | mbz)) == mbs) &&
+             ptwr_do_page_fault(v, addr, regs) )
+            return EXCRET_fault_fixed;
+    }
 
     /* For non-external shadowed guests, we fix up both their own 
      * pagefaults and Xen's, since they share the pagetables. */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] x86: tighten filter on ptwr_do_page_fault(), Xen patchbot-4.0-testing <=