[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] grant table and bogus mfns



On Mon, 2007-11-12 at 09:35 +0000, Kieran Mansley wrote:
> I can test and provide a patch for this later today.

Here it is.  I left in the check of the remote domain's iomem permission
as although it is unnecessary in the case of dom0 providing the grant it
still makes logical sense.  Thanks for pointing this problem out.

Signed-off-by Kieran Mansley <kmansley@xxxxxxxxxxxxxx>

diff -r e40591366a0f xen/common/grant_table.c
--- a/xen/common/grant_table.c  Mon Nov 12 09:53:14 2007 +0000
+++ b/xen/common/grant_table.c  Mon Nov 12 11:49:19 2007 +0000
@@ -332,7 +332,9 @@ __gnttab_map_grant_ref(
     if ( op->flags & GNTMAP_host_map ) 
     {
         /* Could be an iomem page for setting up permission */
-        if ( is_iomem_page(frame) )
+        if ( rd->domain_id == 0 && 
+             is_iomem_page(frame) &&
+             iomem_access_permitted(rd, frame, frame) )
         {
             is_iomem = 1;
             if ( iomem_permit_access(ld, frame, frame) )
@@ -527,7 +529,8 @@ __gnttab_unmap_common(
                                                   op->flags)) < 0 )
                 goto unmap_out;
         }
-        else if ( is_iomem_page(op->frame) &&
+        else if ( rd->domain_id == 0 &&
+                  is_iomem_page(op->frame) &&
                   iomem_access_permitted(ld, op->frame, op->frame) )
         {
             if ( (rc = iomem_deny_access(ld, op->frame, op->frame)) < 0 )



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.