From: Ian Campbell Subject: Re: [PATCH] libxenctrl: Fix xc_interface_close() crash if it gets NULL as an argument Date: Wed, 4 Dec 2013 14:53:25 +0000 Message-ID: <1386168805.17466.89.camel@kazak.uk.xensource.com> References: <1386011583-29413-1-git-send-email-daniel.kiper@oracle.com> <1386064055.16012.45.camel@kazak.uk.xensource.com> <20131203115856.GC21544@olila.local.net-space.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131203115856.GC21544@olila.local.net-space.pl> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel Kiper 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, 2013-12-03 at 12:58 +0100, Daniel Kiper wrote: > 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. And now applied. > > Did you observe this with a particular caller? > > Yes, I found this issue by chance in kaxec-tools. It is fixed Great, thanks. > right now but I agree that this type of functions should > behave with NULL like free(NULL). > > Daniel