Daniel De Graaf
2011-Nov-18 18:18 UTC
[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 <dgdegra@tycho.nsa.gov> --- xen/xsm/flask/hooks.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index e70feda..1cfa621 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); -- 1.7.7.1