[ovs-git] Open vSwitch: ofproto: Fix use-after-free error when ports disappear. (master)

dev at openvswitch.org dev at openvswitch.org
Mon Apr 23 20:58:02 UTC 2012


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, master has been updated
       via  7436ed8071a045f265ab3e06c5d7b0d5d678db1c (commit)
      from  8a899ac4451757e55afdb1b1f3701b0b4b65d6d6 (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 7436ed8071a045f265ab3e06c5d7b0d5d678db1c
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7436ed8071a045f265ab3e06c5d7b0d5d678db1c
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Fix use-after-free error when ports disappear.
		
update_port() can delete the port for which it is called, if the underlying
network device has been destroyed, so HMAP_FOR_EACH is unsafe in
ofproto_run().

Less obviously, update_port() can delete unrelated ports.  For example,
suppose that initially device A is port 1 and device B is port 2.  If
update_port("A") runs just after this, then it will ofport_remove() both
ports, then ofport_install() A as the new port 2.

So this commit first assembles a list of ports to update, then updates them
in a separate loop.

Without this commit, running "ovs-dpctl del-dp" while ovs-vswitchd is
running consistently causes a crash for me within a few seconds.

Signed-off-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 ofproto/ofproto.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list