From: Ian Jackson Subject: Re: [PATCH] tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove() Date: Wed, 2 Jul 2014 16:07:04 +0100 Message-ID: <21428.8216.442882.204090@mariner.uk.xensource.com> References: <1403114655-4314-1-git-send-email-andrew.cooper3@citrix.com> <21416.24529.19720.729286@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21416.24529.19720.729286@mariner.uk.xensource.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 , Xen-devel , Wei Liu , Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org Ian Jackson writes ("Re: [PATCH] tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()"): > Andrew Cooper writes ("[PATCH] tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()"): > > 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(). ... > Acked-by: Ian Jackson > Committed-by: Ian Jackson This has been backported to 4.4. It isn't applicable to 4.3 and earlier. FYI: While investigating why it didn't apply, I discovered that the changeset blamed by Andrew isn't actually the real culprit. The real culprit IMO is f39b1af257e3 "libxl: remove the Qemu bodge for driver domain devices" which was by Roger and acked by me. That change moves libxl_dominfo_init(&info) from the start of the function to a branch of an if(), but doesn't move the corresponding variable. Ie it introduced a violation of our principle that variables should all be initialised to a (noop)-freeable value; that violation was latent bug. Ian.