diff options
author | pravin shelar <pshelar@ovn.org> | 2016-10-28 09:59:15 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-29 20:56:31 -0400 |
commit | c6fcc4fc5f8b592600c7409e769ab68da0fb1eca (patch) | |
tree | 4fafb69c92e2169209dfb66452b7d92e8abfb11c /include/net | |
parent | 087892d29b75c025086d99b29d385a3dac0169fc (diff) |
vxlan: avoid using stale vxlan socket.
When vxlan device is closed vxlan socket is freed. This
operation can race with vxlan-xmit function which
dereferences vxlan socket. Following patch uses RCU
mechanism to avoid this situation.
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/vxlan.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 0255613a54a4..308adc4154f4 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -225,9 +225,9 @@ struct vxlan_config { struct vxlan_dev { struct hlist_node hlist; /* vni hash table */ struct list_head next; /* vxlan's per namespace list */ - struct vxlan_sock *vn4_sock; /* listening socket for IPv4 */ + struct vxlan_sock __rcu *vn4_sock; /* listening socket for IPv4 */ #if IS_ENABLED(CONFIG_IPV6) - struct vxlan_sock *vn6_sock; /* listening socket for IPv6 */ + struct vxlan_sock __rcu *vn6_sock; /* listening socket for IPv6 */ #endif struct net_device *dev; struct net *net; /* netns for packet i/o */ |