]> xenbits.xensource.com Git - people/vhanquez/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:37:26 +0000 (13:37 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 22 Nov 2011 13:37:26 +0000 (13:37 +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-unstable changeset:   24176:0db9c1fc8213
xen-unstable date:        Tue Nov 22 13:29:01 2011 +0000

xen/xsm/flask/hooks.c

index 6369c59512e6ebb8a5b7ba93bd561323e7b2d1e4..ac5af6872bb8ef2fc8a1f19b53fa6755390543cd 100644 (file)
@@ -278,7 +278,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);