From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: [PATCH] xsm/flask: Use correct flag to detect writable grant mappings Date: Fri, 18 Nov 2011 13:18:28 -0500 Message-ID: <1321640308-20885-1-git-send-email-dgdegra@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel@lists.xensource.com Cc: Daniel De Graaf List-Id: xen-devel@lists.xenproject.org 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 --- 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