From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2] libxc: fix memory leak in migration v2 Date: Mon, 27 Jul 2015 09:50:21 +0100 Message-ID: <1437987021.28924.23.camel@citrix.com> References: <1437946494-19499-1-git-send-email-wei.liu2@citrix.com> <55B552C5.7020006@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZJe7h-0002eo-R5 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2015 08:51:01 +0000 In-Reply-To: <55B552C5.7020006@citrix.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: Andrew Cooper , Wei Liu , Xen-devel Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org On Sun, 2015-07-26 at 22:36 +0100, Andrew Cooper wrote: > On 26/07/2015 22:34, Wei Liu wrote: > > Originally there was only one counter to keep track of pages. It > was > > used erroneously to keep track of how many pages were mapped and > how > > many pages needed to be sent. In the end munmap(2) always had 0 as > the > > length argument, which resulted in leaking the mapping. > > > > This problem was discovered on 32bit toolstack because 32bit > applications > > have notably smaller address space. In fact this bug affects 64bit > > toolstack too. > > > > Use a separate counter to keep track of the number of mapped pages > to > > solve this problem. > > > > Signed-off-by: Wei Liu > > --- > > Cc: Andrew Cooper > > Reviewed-by: Andrew Cooper acked and applied, thanks all.