WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xenbus: fix possible crash in xenbus_uevent_back

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenbus: fix possible crash in xenbus_uevent_backend
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 18 Jul 2011 17:02:58 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 18 Jul 2011 08:05:30 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311001380; l=1085; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=u3v97haXWKct7Faj6fR4SC2HpU4=; b=uxMGvpnZBjCX5Oej2vV0iV/MbQKJlkjXRrOWX4T0C7BGPhdRfAn3zO1r7keedDKbn0v Nb3ummR4ZsptW+WD1IvAHbd0KoB1ncze9TNvAnalWCVMCx4ovcII/XT+yewOKvE2I76oj awQ77ObipVfePBNzqdvYYnc/7WEcVtJIKNA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1310994684.20648.47.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110718124059.GA7893@xxxxxxxxx> <1310994684.20648.47.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21.rev5535 (2011-07-01)
On Mon, Jul 18, Ian Campbell wrote:

> On Mon, 2011-07-18 at 13:40 +0100, Olaf Hering wrote:
> > Fix possible NULL pointer crash in xenbus_uevent_backend().
> > The variable to check for should probably be bus.
> > 
> > Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
> > 
> > Index: linux-3.0-rc7-xen-kexec/drivers/xen/xenbus/xenbus_probe_backend.c
> > ===================================================================
> > --- linux-3.0-rc7-xen-kexec.orig/drivers/xen/xenbus/xenbus_probe_backend.c
> > +++ linux-3.0-rc7-xen-kexec/drivers/xen/xenbus/xenbus_probe_backend.c
> > @@ -104,7 +104,7 @@ static int xenbus_uevent_backend(struct
> >  
> >     xdev = to_xenbus_device(dev);
> >     bus = container_of(xdev->dev.bus, struct xen_bus_type, bus);
> > -   if (xdev == NULL)
> > +   if (bus == NULL)
> >             return -ENODEV;
> 
> Is this fixing an actual crash which you observed of just something you
> noticed looking at the code?

I was browsing the code.

Thanks to you and Jan for reviewing my attempt to fix something thats
not broken. I will prepare a better patch.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel