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] Bug fix for shadow_get_page_from_l1e(). Don't try to loo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Bug fix for shadow_get_page_from_l1e(). Don't try to look for the
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Tue, 15 Mar 2005 12:30:46 +0000
Delivery-date: Tue, 05 Apr 2005 16:08:19 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1236.33.3, 2005/03/15 12:30:46+00:00, mafetter@xxxxxxxxxxxxxxxx

        Bug fix for shadow_get_page_from_l1e().  Don't try to look for the
        owner of an invalid mfn.
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 arch/x86/shadow.c        |    3 ++-
 include/asm-x86/shadow.h |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)


diff -Nru a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     2005-04-05 12:08:25 -04:00
+++ b/xen/arch/x86/shadow.c     2005-04-05 12:08:25 -04:00
@@ -1724,7 +1724,8 @@
         unsigned long opte = *ppte;
         unsigned long npte = opte & ~_PAGE_RW;
 
-        shadow_get_page_from_l1e(mk_l1_pgentry(npte), d);
+        if ( npte & _PAGE_PRESENT)
+            shadow_get_page_from_l1e(mk_l1_pgentry(npte), d);
         *ppte = npte;
         put_page_from_l1e(mk_l1_pgentry(opte), d);
 
diff -Nru a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      2005-04-05 12:08:24 -04:00
+++ b/xen/include/asm-x86/shadow.h      2005-04-05 12:08:25 -04:00
@@ -246,9 +246,15 @@
 shadow_get_page_from_l1e(l1_pgentry_t l1e, struct domain *d)
 {
     int res = get_page_from_l1e(l1e, d);
+    unsigned long mfn;
     struct domain *owner;
 
+    ASSERT( l1_pgentry_val(l1e) & _PAGE_PRESENT );
+
     if ( unlikely(!res) && IS_PRIV(d) && !shadow_mode_translate(d) &&
+         !(l1_pgentry_val(l1e) & L1_DISALLOW_MASK) &&
+         (mfn = l1_pgentry_to_pfn(l1e)) &&
+         pfn_is_ram(mfn) &&
          (owner = page_get_owner(pfn_to_page(l1_pgentry_to_pfn(l1e)))) &&
          (d != owner) )
     {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Bug fix for shadow_get_page_from_l1e(). Don't try to look for the, BitKeeper Bot <=