From: Tim Deegan Subject: Re: [PATCH] x86/mm: fix invalid unlinking of nested p2m tables Date: Thu, 28 Feb 2013 10:59:34 +0000 Message-ID: <20130228105934.GC27704@ocelot.phlegethon.org> References: <1362028564-8627-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1362028564-8627-1-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Daley Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 18:16 +1300 on 28 Feb (1362075364), Matthew Daley wrote: > Commit 90805dc (c/s 26387:4056e5a3d815) ("EPT: Make ept data stucture or > operations neutral") makes nested p2m tables be unlinked from the host > p2m table before their destruction (in p2m_teardown_nestedp2m). > However, by this time the host p2m table has already been torn down, > leading to a possible race condition where another allocation between > the two kinds of table being torn down can lead to a linked list > assertion with debug=y builds or memory corruption on debug=n ones. > > Fix by swapping the order the two kinds of table are torn down in. While > at it, remove the condition in p2m_final_teardown, as it is already > checked identically in p2m_teardown_hostp2m itself. > > Signed-off-by: Matthew Daley Applied, thanks. Tim.