From e7e7a8626797ff675113a2f3623680ee56871212 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Tue, 22 Nov 2011 13:29:01 +0000 Subject: [PATCH] xsm/flask: Use correct flag to detect writable grant mappings 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 Committed-by: Keir Fraser --- xen/xsm/flask/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index e70feda5a4..a17f02ab78 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -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); -- 2.39.5