[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/netback: Fix null-pointer access in netback_uevent



 On 07/29/2010 08:30 AM, Bastian Blank wrote:
On Thu, Jul 29, 2010 at 02:44:36PM +0100, Ian Campbell wrote:
On Thu, 2010-07-29 at 13:42 +0100, Bastian Blank wrote:
Yes, this is included since 2.6.32-15.
The patch from<20100529184452.GA18365@xxxxxxxxxxxxxxxxxxxxxxx>?
Currently the following patch is used. The next test should be if it is
really necessary to have this much different structures, a quick look
said: most likely no.

OK, I'll stick it in.  Do you have a complete commit comment?

Thanks,
    J
diff --git a/drivers/xen/netback/xenbus.c b/drivers/xen/netback/xenbus.c
index 99831c7..1930f64 100644
--- a/drivers/xen/netback/xenbus.c
+++ b/drivers/xen/netback/xenbus.c
@@ -162,17 +162,11 @@ fail:
   */
  static int netback_uevent(struct xenbus_device *xdev, struct kobj_uevent_env 
*env)
  {
-       struct backend_info *be;
-       struct xen_netif *netif;
+       struct backend_info *be = dev_get_drvdata(&xdev->dev);
        char *val;

        DPRINTK("netback_uevent");

-       be = dev_get_drvdata(&xdev->dev);
-       if (!be)
-               return 0;
-       netif = be->netif;
-
        val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
        if (IS_ERR(val)) {
                int err = PTR_ERR(val);
@@ -187,7 +181,7 @@ static int netback_uevent(struct xenbus_device *xdev, 
struct kobj_uevent_env *en
                kfree(val);
        }

-       if (add_uevent_var(env, "vif=%s", netif->dev->name))
+       if (be&&  be->netif&&  add_uevent_var(env, "vif=%s", 
be->netif->dev->name))
                return -ENOMEM;

        return 0;



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.