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

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

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen/netback: Fix null-pointer access in netback_uevent
From: Bastian Blank <waldi@xxxxxxxxxx>
Date: Sat, 29 May 2010 20:44:52 +0200
Cc:
Delivery-date: Sat, 29 May 2010 11:45:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100529064411.GA12168@xxxxxxxxxxxxxxxxxxxxxxx>
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>
Mail-followup-to: Bastian Blank <waldi@xxxxxxxxxx>, James Harper <james.harper@xxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <20100527165558.GA11358@xxxxxxxxxxxxxxxxxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D01996BD8@trantor> <AEC6C66638C05B468B556EA548C1A77D01996BDB@trantor> <AEC6C66638C05B468B556EA548C1A77D01996BE0@trantor> <20100528090325.GA13575@xxxxxxxxxxxxxxxxxxxxxxx> <4BFFFD30.6000807@xxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D01996C1F@trantor> <4C005228.5060107@xxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D01996C20@trantor> <20100529064411.GA12168@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
The uevent method of Xen netback does not check if the the network
device is already setup and tries to dereference a null-pointer it not.

Signed-off-by: Bastian Blank <waldi@xxxxxxxxxx>
---
 drivers/xen/netback/xenbus.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/netback/xenbus.c b/drivers/xen/netback/xenbus.c
index 70636d0..88262bb 100644
--- a/drivers/xen/netback/xenbus.c
+++ b/drivers/xen/netback/xenbus.c
@@ -163,7 +163,6 @@ fail:
 static int netback_uevent(struct xenbus_device *xdev, struct kobj_uevent_env 
*env)
 {
        struct backend_info *be = dev_get_drvdata(&xdev->dev);
-       struct xen_netif *netif = be->netif;
        char *val;
 
        DPRINTK("netback_uevent");
@@ -182,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;
-- 
1.7.1

-- 
To live is always desirable.
                -- Eleen the Capellan, "Friday's Child", stardate 3498.9

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