[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access


  • To: Ian Campbell <ian.campbell@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
  • Date: Wed, 3 Feb 2016 13:54:54 +0200
  • Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Wed, 03 Feb 2016 12:15:34 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=jvEEdZYbe4y6xZFPbrNFT2iMr00BrTDklG2ObPENuMyJ8fxYaqhl4VnMWHG/xsshUZ8JDXRyMqKp/vIn4crYODBJx3+dJhzMc3cs9G2gk5HJEOR2/Xcp1z9KagSie0lDplrbOPid7Ow5OU7sLPYliUpQ8WCe9DkVD/C+WZxZ/URJaP5iwSjKQajn4zfzvGfDFzAUZpt5jiQHRZHakvDYGycdHbjsKHV3nQSbkDC5x4PGvL02inrqzQxzhtCdUWg+GDvdF8ydudaBjKCiWiR5RnN3+ugdozDQe5UU0hTR7ziwRiabL8M9clzDOztELkp3RINy+bWnhACNYO+RSGiRMg==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 2/3/2016 1:48 PM, Ian Campbell wrote:
On Wed, 2016-01-27 at 14:24 +0200, Corneliu ZUZU wrote:
When __p2m_get_mem_access gets called, the p2m lock is already taken
by either get_page_from_gva or p2m_get_mem_access.

Possible code paths:
1)      -> get_page_from_gva
                -> p2m_mem_access_check_and_get_page
                        -> __p2m_get_mem_access
2)      -> p2m_get_mem_access
                -> __p2m_get_mem_access

In both cases if __p2m_get_mem_access subsequently gets to
call p2m_lookup (happens if !radix_tree_lookup(...)), a hypervisor
hang will occur, since p2m_lookup also spin-locks on the p2m lock.

This bug-fix simply replaces the p2m_lookup call from
__p2m_get_mem_access
with a call to __p2m_lookup.

Following Ian's suggestion, we also add an ASSERT to ensure that
the p2m lock is taken upon __p2m_get_mem_access entry.

Signed-off-by: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
Acked + applied, thanks.


I thought this mail was not sent properly (didn't find it any longer on the web (?)) and I resent it just earlier. I figured it must've been the fact that I forgot to put a "Changed since v1" section & that I didn't include an
"--in-reply-to" option. Apparently it was actually sent correctly.
Sorry, ignore the last one (which contains a "Changed since v1" section).

Corneliu.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.