From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: [PATCH 2/5] xsm: label xen-consumer event channels Date: Tue, 28 Feb 2012 18:27:14 -0500 Message-ID: <1330471637-8104-2-git-send-email-dgdegra@tycho.nsa.gov> References: <1330471637-8104-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: In-Reply-To: <1330471637-8104-1-git-send-email-dgdegra@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Daniel De Graaf , keir@xen.org List-Id: xen-devel@lists.xenproject.org Event channels created during the domain build process for HVM domains did not call the XSM creation hook. Since these channels are used internally by Xen, redirect them to DOMAIN_INVAID instead of failing to create if the XSM hook fails the permissions check. Signed-off-by: Daniel De Graaf --- xen/common/event_channel.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 989ebae..ce309da 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -1106,6 +1106,7 @@ int alloc_unbound_xen_event_channel( struct evtchn *chn; struct domain *d = local_vcpu->domain; int port; + int rc; spin_lock(&d->event_lock); @@ -1113,10 +1114,15 @@ int alloc_unbound_xen_event_channel( goto out; chn = evtchn_from_port(d, port); + rc = xsm_evtchn_unbound(d, chn, remote_domid); + chn->state = ECS_UNBOUND; chn->xen_consumer = get_xen_consumer(notification_fn); chn->notify_vcpu_id = local_vcpu->vcpu_id; - chn->u.unbound.remote_domid = remote_domid; + if ( rc ) + chn->u.unbound.remote_domid = DOMID_INVALID; + else + chn->u.unbound.remote_domid = remote_domid; out: spin_unlock(&d->event_lock); -- 1.7.7.6