]> git.proxmox.com Git - mirror_ovs.git/commit - ofproto/bond.c
ofproto/bond: Fix a race condition in updating post recirculation rules
authorAndy Zhou <azhou@nicira.com>
Thu, 12 Feb 2015 23:10:28 +0000 (15:10 -0800)
committerAndy Zhou <azhou@nicira.com>
Tue, 17 Feb 2015 22:03:27 +0000 (14:03 -0800)
commitca8127fdc0fe16d44459550af2b8f175487bd700
tree797fbe31ca49472452cc66f687ec58271ba3b6a2
parent737ea41107f18d2b55e2d38be0eb90f2d2432236
ofproto/bond: Fix a race condition in updating post recirculation rules

When updating post recirc rules, rule management requires calls to
hmap APIs, which requires proper locking to ensure mutual exclsion in
accessing the hmap internal data structure. The locking currently is
missing from the output_normal() xlate path, thus causing
a race condition.

The race condition leads to segfault crash of ovs-vswitchd, with the
following stack trace:

The crash was found by adding and deleting bond interfaces repeatedly
with on-going traffic hitting the bond interfaces.  The same test was
ran over multiple days with this patch to ensure the same crash was
not seen.

The patch added the necessary lock annotation that would have caught
the bug.

Tested-by: Salvatore Cambria <salvatore.cambria@citrix.com>
Reported-by: Salvatore Cambria <salvatore.cambria@citrix.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
AUTHORS
ofproto/bond.c