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

Ben Pfaff blp at nicira.com
Thu Dec 27 20:21:28 UTC 2012


On Thu, Dec 27, 2012 at 02:46:04PM -0500, Jesse Gross wrote:
> On Thu, Dec 27, 2012 at 2:36 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Thu, Dec 27, 2012 at 12:37:27PM -0500, Jesse Gross wrote:
> >> On Wed, Dec 26, 2012 at 8:16 PM, Ethan Jackson <ethan at nicira.com> 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
> >> > this case, netdev-vport would dereference a null pointer.  This
> >> > problem was found by Jesse Gross <jesse at nicira.com> in review.
> >> >
> >> > Signed-off-by: Ethan Jackson <ethan at nicira.com>
> >>
> >> Shouldn't we just fetch the config?  It's pretty easy and seems a lot
> >> less likely to cause surprises in the future.
> >
> > As long as we're talking about theoretical situations, it's possible
> > that the vport doesn't exist in the kernel yet.  We let vports be
> > created and configured in userspace before they get added to a
> > datapath.  In between, they're just userspace configuration data.
> 
> That's true and in that case if we don't have a config then this patch
> clearly does the right thing.  However, we also use the netdev library
> to also pull the current config from the kernel.  If we used this for
> something like ovs-dpctl (which we don't) then it would give the wrong
> result.
> 
> I think making it fetch the config is the right thing to do, although
> since the code is going away and it's not a current problem it may not
> be worth it (although I think the necessary refactoring is minimal).

I don't object to either solution.



More information about the dev mailing list