From: Wei Liu Subject: Re: [PATCH v2] tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove() Date: Wed, 18 Jun 2014 19:58:24 +0100 Message-ID: <20140618185824.GA32588@zion.uk.xensource.com> References: <1403114655-4314-1-git-send-email-andrew.cooper3@citrix.com> <1403114993-4514-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: Content-Disposition: inline In-Reply-To: <1403114993-4514-1-git-send-email-andrew.cooper3@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 Cc: Ian Jackson , Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Jun 18, 2014 at 07:09:53PM +0100, Andrew Cooper wrote: > libxl__initiate_device_remove() had a preexisting error path issue where > libxl_dominfo_dispose() could be called on a libxl_dominfo object before it > had been initialised with libxl_dominfo_init(). > > This was safe until c/s ab44401 "xl / libxl: push parsing of SSID and CPU pool > ID down to libxl" added the ssid_label string into libxl_dominfo, which > libxl_dominfo_dispose() will free(). > > Unconditionally initialise info in libxl__initiate_device_remove() before > taking an error path which will free it. > > Coverity-ID: 1223212 > Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu Thanks Wei.