]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: synchronously and race-free destruction of vxlan sockets
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Fri, 8 Apr 2016 20:55:01 +0000 (22:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Apr 2016 22:23:01 +0000 (18:23 -0400)
commitfb70e85f213fe09eb5d7aa85f28a2d2ac3abf7d3
treee7fe97a778ac5b9ce73d5e8becd5192d5924a734
parent813447dfc8e34d8e9c340f778dc2825ed3328fc8
vxlan: synchronously and race-free destruction of vxlan sockets

Due to the fact that the udp socket is destructed asynchronously in a
work queue, we have some nondeterministic behavior during shutdown of
vxlan tunnels and creating new ones. Fix this by keeping the destruction
process synchronous in regards to the user space process so IFF_UP can
be reliably set.

udp_tunnel_sock_release destroys vs->sock->sk if reference counter
indicates so. We expect to have the same lifetime of vxlan_sock and
vxlan_sock->sock->sk even in fast paths with only rcu locks held. So
only destruct the whole socket after we can be sure it cannot be found
by searching vxlan_net->sock_list.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jiri Benc <jbenc@redhat.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
include/net/vxlan.h