]> xenbits.xensource.com Git - xen.git/commitdiff
xsm/flask: Use correct flag to detect writable grant mappings
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 22 Nov 2011 13:29:01 +0000 (13:29 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 22 Nov 2011 13:29:01 +0000 (13:29 +0000)
The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen/xsm/flask/hooks.c

index e70feda5a4c80dd91d0dd96c98661ef4a8bd9187..a17f02ab78d3c339b9984b34b12170048a743f50 100644 (file)
@@ -279,7 +279,7 @@ static int flask_grant_mapref(struct domain *d1, struct domain *d2,
 {
     u32 perms = GRANT__MAP_READ;
 
-    if ( flags & GTF_writing )
+    if ( !(flags & GNTMAP_readonly) )
         perms |= GRANT__MAP_WRITE;
 
     return domain_has_perm(d1, d2, SECCLASS_GRANT, perms);