[ovs-dev] [backport branch-2.3] route-table: Make route-table module thread-safe.
Ben Pfaff
blp at nicira.com
Mon Jul 21 15:57:36 UTC 2014
On Sun, Jul 20, 2014 at 12:43:41AM -0700, Alex Wang wrote:
> From: Ryan Wilson <wryan at nicira.com>
>
> Since the use of xcache, the netdev struct can be freed by the
> revalidator threads. This fact also makes the following race possible:
>
> 1. Consider there is a gre tunnel, and datapath flows that go through
> the tunnel. Now, assume user deletes the tunnel port.
> 2. The main thread closes all of its references to the corresponding
> netdev struct.
> 3. If the ukey for the tunnel datapath flows hold the last reference
> to the old port's netdev, the revalidator will then close it
> and remove the netlink notifier struct (if the netdev is the last
> vport netdev).
> 4. However, if the main thread executes the netdev_vport_run(), and
> sees the existence of netlink notifier struct (before revalidator
> frees it), it will try polling updates from the notifier socket.
> And when it polls the socket fd, the fd has already been freed,
> and poll will keep failing with "Bad file descriptor".
>
> This race has already been fixed on master by commit 3c27dbe6 (route
> -table: Make route-table module thread-safe.). This commit backports
> it to branch-2.3.
>
> VMware-BZ: #1287360
>
> Signed-off-by: Alex Wang <alexw at nicira.com>
This should reproduce Ryan's Signed-off-by from the original commit.
Acked-by: Ben Pfaff <blp at nicira.com>
More information about the dev
mailing list