xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Bastian Blank <waldi@debian.org>
To: James Harper <james.harper@bendigoit.com.au>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com
Subject: [PATCH] xen/netback: Fix null-pointer access in netback_uevent
Date: Sat, 29 May 2010 20:44:52 +0200	[thread overview]
Message-ID: <20100529184452.GA18365@wavehammer.waldi.eu.org> (raw)
In-Reply-To: <20100529064411.GA12168@wavehammer.waldi.eu.org>

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@debian.org>
---
 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

  reply	other threads:[~2010-05-29 18:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 16:55 Null-pointer access in netback_uevent Bastian Blank
2010-05-27 21:03 ` Jeremy Fitzhardinge
2010-05-27 22:27   ` Bastian Blank
2010-05-27 22:39     ` Jeremy Fitzhardinge
2010-05-27 23:02       ` Bastian Blank
2010-05-28  0:04 ` James Harper
2010-05-28  0:33   ` James Harper
2010-05-28  0:47     ` James Harper
2010-05-28  9:03       ` Bastian Blank
2010-05-28 17:28         ` Jeremy Fitzhardinge
2010-05-28 22:42           ` James Harper
2010-05-28 23:30             ` Jeremy Fitzhardinge
2010-05-28 23:59               ` James Harper
2010-05-29  6:44                 ` Bastian Blank
2010-05-29 18:44                   ` Bastian Blank [this message]
2010-05-31  7:37                     ` [PATCH] xen/netback: Fix null-pointer " Jan Beulich
2010-05-31  8:07                       ` Jan Beulich
2010-07-28 16:20                         ` Bastian Blank
2010-07-29 11:47                           ` Ian Campbell
2010-07-29 12:42                             ` Bastian Blank
2010-07-29 13:44                               ` Ian Campbell
2010-07-29 13:48                                 ` Ian Campbell
2010-07-29 15:30                                 ` Bastian Blank
2010-07-29 15:40                                   ` Jeremy Fitzhardinge
2010-07-29 17:08                                     ` Bastian Blank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100529184452.GA18365@wavehammer.waldi.eu.org \
    --to=waldi@debian.org \
    --cc=james.harper@bendigoit.com.au \
    --cc=jeremy@goop.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).