From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH] xenpaging: fix crash in notify_via_xen_event_channel Date: Wed, 15 Sep 2010 18:11:46 +0200 Message-ID: <20100915161146.GC16689@aepfle.de> References: <20100915160521.GA16644@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20100915160521.GA16644@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Patrick Colp Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Avoid crash of Xen if a xenpaging enabled guest crashes and there are still memevents in flight, as reported here: http://lists.xensource.com/archives/html/xen-devel/2010-08/msg00516.html Signed-off-by: Olaf Hering --- xen/common/event_channel.c | 6 ++++++ 1 file changed, 6 insertions(+) --- xen-unstable.hg-4.1.22132.orig/xen/common/event_channel.c +++ xen-unstable.hg-4.1.22132/xen/common/event_channel.c @@ -1030,6 +1030,12 @@ void notify_via_xen_event_channel(struct spin_lock(&ld->event_lock); + if ( unlikely(ld->is_dying) ) + { + spin_unlock(&ld->event_lock); + return; + } + ASSERT(port_is_valid(ld, lport)); lchn = evtchn_from_port(ld, lport); ASSERT(lchn->consumer_is_xen);