[ovs-dev] [PATCH 2/6] netdev-vport: Fix theoretical null pointer dereference.

Ethan Jackson ethan at nicira.com
Thu Jan 3 01:17:41 UTC 2013


Thanks for the comments, I've folded them in.

On Thu, Dec 27, 2012 at 11:34 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Wed, Dec 26, 2012 at 05:16:42PM -0800, Ethan Jackson wrote:
> > Theoretically, it's possible for netdev_get_status() to be called
> > on a netdev-vport which hasn't had it's configuration set yet.  In
>
> s/it's/its/
>
> > this case, netdev-vport would dereference a null pointer.  This
> > problem was found by Jesse Gross <jesse at nicira.com> in review.
>
> I usually would write this as:
> Reported-by: Jesse Gross <jesse at nicira.com>
>
> > Signed-off-by: Ethan Jackson <ethan at nicira.com>
> > ---
> >  lib/netdev-vport.c |    6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
> > index e50103b..9bb5d36 100644
> > --- a/lib/netdev-vport.c
> > +++ b/lib/netdev-vport.c
> > @@ -460,6 +460,12 @@ netdev_vport_get_tnl_iface(const struct netdev
> *netdev)
> >      static char name[IFNAMSIZ];
> >
> >      ndv = netdev_dev_vport_cast(netdev_get_dev(netdev));
> > +    if (!ndv->options) {
> > +        /* Race condition when 'ndv' was created, but did not have it's
>
> s/it's/its/
>
> > +         * configuration set yet. */
> > +        return NULL;
> > +    }
> > +
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130102/5c6e4f83/attachment-0003.html>


More information about the dev mailing list