[ovs-git] Open vSwitch: dpif-linux: Avoid null dereference if all ports disappear. (branch-2.0)
dev at openvswitch.org
dev at openvswitch.org
Tue Jul 15 18:04:55 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".
The branch, branch-2.0 has been updated
via 0a476db4a2c9f1bf655047233bd09c2a6e8bf4ff (commit)
from b60a5e7df8bab86cc901e75aa37f5af803f1a5ce (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0a476db4a2c9f1bf655047233bd09c2a6e8bf4ff
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0a476db4a2c9f1bf655047233bd09c2a6e8bf4ff
Author: Ben Pfaff <blp at nicira.com>
dpif-linux: Avoid null dereference if all ports disappear.
When dpif_linux_refresh_channels() refreshes the set of channels when
the number of handlers changes, it destroys all the dpif's channels and
sets dpif->uc_array_size to 0. If the port dump later in the function
turns up no ports (which generally indicates a bug), then no channels will
be allocated and thus dpif->uc_array_size will remain 0 and 'channels' will
be null in each handler. This is self-consistent, at least, but
dpif_linux_port_get_pid__() was still willing in this situation to
try to access element 0 of the set of channels, dereferencing a null
pointer.
This fixes the problem.
I encountered this while looking at a bug that I had introduced during
development that caused the port dump to always be empty. It would be
difficult to encounter in normal use.
Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Joe Stringer <joestringer at nicira.com>
-----------------------------------------------------------------------
Summary of changes:
lib/dpif-linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Open vSwitch
More information about the git
mailing list