From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Bastian Blank <waldi@debian.org>,
Ian Campbell <Ian.Campbell@eu.citrix.com>,
Jan Beulich <JBeulich@novell.com>,
James Harper <james.harper@bendigoit.com.au>,
xen-devel@lists.xenso
Subject: Re: [PATCH] xen/netback: Fix null-pointer access in netback_uevent
Date: Thu, 29 Jul 2010 08:40:30 -0700 [thread overview]
Message-ID: <4C51A0EE.1030808@goop.org> (raw)
In-Reply-To: <20100729153018.GA12495@wavehammer.waldi.eu.org>
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@wavehammer.waldi.eu.org>?
> 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;
>
next prev parent reply other threads:[~2010-07-29 15:40 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 ` [PATCH] xen/netback: Fix null-pointer " Bastian Blank
2010-05-31 7:37 ` 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 [this message]
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=4C51A0EE.1030808@goop.org \
--to=jeremy@goop.org \
--cc=Ian.Campbell@eu.citrix.com \
--cc=JBeulich@novell.com \
--cc=james.harper@bendigoit.com.au \
--cc=waldi@debian.org \
--cc=xen-devel@lists.xenso \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.