]> xenbits.xensource.com Git - xen.git/commitdiff
Extra check in grant table code for mapping of shared frame
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Mon, 17 Sep 2012 16:51:57 +0000 (17:51 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Mon, 17 Sep 2012 16:51:57 +0000 (17:51 +0100)
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/grant_table.c

index c23c053db62ee18b1e03b5e510ce69bb535051d5..c8e342b554df9fe68e9b3e5e6cd9abdc1a82bffb 100644 (file)
@@ -708,9 +708,12 @@ __gnttab_map_grant_ref(
     }
     else if ( owner == rd || owner == dom_cow )
     {
-        if ( gnttab_host_mapping_get_page_type(op, ld, rd) &&
-             !get_page_type(pg, PGT_writable_page) )
-            goto could_not_pin;
+        if ( gnttab_host_mapping_get_page_type(op, ld, rd) )
+        {
+            if ( (owner == dom_cow) ||
+                 !get_page_type(pg, PGT_writable_page) )
+                goto could_not_pin;
+        }
 
         nr_gets++;
         if ( op->flags & GNTMAP_host_map )