]> www.infradead.org Git - users/jedix/linux-maple.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)
committerBrian Maly <brian.maly@oracle.com>
Wed, 12 Jun 2019 15:15:58 +0000 (11:15 -0400)
commit5928f9dbfab3ed36afcb342b2815cf8010dc18e7
treea7744fb1fff7ffc009a71a7a534d19cacefb04ee
parent8acb266523e9f2465f0d2507d806dbfd9c1e8a5e
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.

Orabug: 29755932

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>
(cherry picked from commit 0412bd931f5f94d1054e958415c4a945d8ee62f4)

Reviewed-by: Rama Nichanamatlu <rama.nichanamatlu@oracle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/vxlan.c
include/net/vxlan.h