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-unstable] x86: add an extra check when validating a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: add an extra check when validating a huge pv L2 entry
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Sep 2009 08:45:14 -0700
Delivery-date: Wed, 09 Sep 2009 08:45:31 -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 1252510781 -3600
# Node ID d2a32e24fe504b9626e6732b4f213c7cb1bc8b57
# Parent  4226e02bdf7105d6e71f0608174ef07b7a94d738
x86: add an extra check when validating a huge pv L2 entry

While get_page_and_type_from_pagenr() (through get_page_from_pagenr())
does the needed mfn_valid() check, get_data_page() doesn't and, it
being passed a struct page_info pointer, really expects it's caller(s)
to do.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/mm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 4226e02bdf71 -r d2a32e24fe50 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Wed Sep 09 16:32:25 2009 +0100
+++ b/xen/arch/x86/mm.c Wed Sep 09 16:39:41 2009 +0100
@@ -844,14 +844,16 @@ get_page_from_l2e(
         int writeable = !!(l2e_get_flags(l2e) & _PAGE_RW);
   
         do {
-            rc = get_data_page(mfn_to_page(m), d, writeable);
-            if ( unlikely(!rc) )
+            if ( !mfn_valid(m) ||
+                 !get_data_page(mfn_to_page(m), d, writeable) )
             {
                 while ( m-- > mfn )
                     put_data_page(mfn_to_page(m), writeable);
                 return -EINVAL;
             }
         } while ( m++ < (mfn + (L1_PAGETABLE_ENTRIES-1)) );
+
+        rc = 1;
     }
 
     return rc;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: add an extra check when validating a huge pv L2 entry, Xen patchbot-unstable <=