ofproto: Fix use-after-free in bridge destruction with groups.
authorBen Pfaff <blp@nicira.com>
Tue, 23 Jun 2015 18:38:56 +0000 (11:38 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 26 Jun 2015 15:44:20 +0000 (08:44 -0700)
commitdaab0ae6bb558411f24cee6a7bb32599a5f9e363
tree908fb808aa28a271129b713e23c21f00a07cac47
parentf08e39dd023ff27c32166b76d6906fbf20f78991
ofproto: Fix use-after-free in bridge destruction with groups.

Groups were not destroyed until after lots of other important bridge
data had been destroyed, including the connection manager.  There was an
indirect dependency on the connection manager for bridge destruction
because destroying a group also destroys all of the flows that reference
the group, which in turn causes the ofmonitor to be invoked to report that
the flows had been destroyed.  This commit fixes the problem by destroying
groups earlier.

The problem can be observed by reverting the code changes in this commit
then running "make check-valgrind" with the test that this commit
introduces.

Reported-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
ofproto/ofproto-dpif.c
ofproto/ofproto-provider.h
ofproto/ofproto.c
tests/ofproto.at