From: Daniel Kiper Subject: Re: [PATCH] libxenctrl: Fix xc_interface_close() crash if it gets NULL as an argument Date: Tue, 3 Dec 2013 12:58:56 +0100 Message-ID: <20131203115856.GC21544@olila.local.net-space.pl> References: <1386011583-29413-1-git-send-email-daniel.kiper@oracle.com> <1386064055.16012.45.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1386064055.16012.45.camel@kazak.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: Ian Campbell Cc: xen-devel@lists.xen.org, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, Dec 03, 2013 at 09:47:35AM +0000, Ian Campbell wrote: > On Mon, 2013-12-02 at 20:13 +0100, Daniel Kiper wrote: > > xc_interface_close() crashes if it gets NULL as an argument. However, > > it just calls xc_interface_close_common() which is called by many > > others functions. It means that they are also vulnerable. So fix above > > mentioned issue by adding NULL check in xc_interface_close_common(). > > This way we fix similar issue in other functions which calls > > xc_interface_close_common() too. > > > > Signed-off-by: Daniel Kiper > > I suppose this makes sense in the same way that free(NULL) does: > Acked-by: Ian Campbell Thanks. > Did you observe this with a particular caller? Yes, I found this issue by chance in kaxec-tools. It is fixed right now but I agree that this type of functions should behave with NULL like free(NULL). Daniel