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] Separate the validity checking of the page frame in 2 ch

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Separate the validity checking of the page frame in 2 chunks.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Jan 2006 13:58:11 +0000
Delivery-date: Wed, 25 Jan 2006 14:08:08 +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 vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID aad2b2da3c8beda24bc62ca6e92b28c28def0849
# Parent  159ef7d83f1c9860cbc5d6adcf10d3752eafffbb
Separate the validity checking of the page frame in 2 chunks.
give a more accurate error message, and don't call pfn_to_page before
validating the pfn.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r 159ef7d83f1c -r aad2b2da3c8b xen/common/grant_table.c
--- a/xen/common/grant_table.c  Wed Jan 25 11:34:02 2006
+++ b/xen/common/grant_table.c  Wed Jan 25 11:51:21 2006
@@ -719,10 +719,18 @@
         }
 
         /* Check the passed page frame for basic validity. */
+        if ( unlikely(!pfn_valid(gop.mfn)) )
+        { 
+            DPRINTK("gnttab_transfer: out-of-range %lx\n",
+                    (unsigned long)gop.mfn);
+            (void)__put_user(GNTST_bad_page, &uop[i].status);
+            continue;
+        }
+
         page = pfn_to_page(gop.mfn);
-        if ( unlikely(!pfn_valid(gop.mfn) || IS_XEN_HEAP_FRAME(page)) )
+        if ( unlikely(IS_XEN_HEAP_FRAME(page)) )
         { 
-            DPRINTK("gnttab_transfer: out-of-range or xen frame %lx\n",
+            DPRINTK("gnttab_transfer: xen frame %lx\n",
                     (unsigned long)gop.mfn);
             (void)__put_user(GNTST_bad_page, &uop[i].status);
             continue;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Separate the validity checking of the page frame in 2 chunks., Xen patchbot -unstable <=