From: "Jan Beulich" Subject: Re: [PATCH] xen/ept: Correct double unmap_domain_page() on error path Date: Wed, 16 Apr 2014 13:00:12 +0100 Message-ID: <534E8CEC02000078000097AD@nat28.tlf.novell.com> References: <1397648265-18330-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1397648265-18330-1-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Tim Deegan , Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 16.04.14 at 13:37, wrote: > c/s 3d90d6e6 "x86/EPT: split super pages upon mismatching memory types" > accidentally introduced an error path where the epte domain page would be > unmapped twice if splitting the superpage failed. > > Only unmap the page if the loop is to be continued. When breaking from the > loop, the page will be unmapped by the subsequent code. > > Coverity-ID: 1203047 > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich > --- a/xen/arch/x86/mm/p2m-ept.c > +++ b/xen/arch/x86/mm/p2m-ept.c > @@ -350,9 +350,9 @@ bool_t ept_handle_misconfig(uint64_t gpa) > e.sa_p2mt == p2m_mmio_direct); > if ( unlikely(emt < 0) ) > { > - unmap_domain_page(epte); > if ( ept_split_super_page(p2m, &e, level, level - 1) ) > { > + unmap_domain_page(epte); > mfn = e.mfn; > continue; > }