aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2016-02-12 09:43:55 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-16 20:21:48 -0500
commite09acddf873bf775b208b452a4c3a3fd26fa9427 (patch)
tree456681d08a1ca3017875d6068c4e102633afff74 /include/net
parent607f725f6f7d5ec3759fbc16224afb60e2152a5b (diff)
ip_tunnel: replace dst_cache with generic implementation
The current ip_tunnel cache implementation is prone to a race that will cause the wrong dst to be cached on cuncurrent dst cache miss and ip tunnel update via netlink. Replacing with the generic implementation fix the issue. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Suggested-and-acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/ip_tunnels.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index bc439f32baa9..fd36936d85a6 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -13,6 +13,7 @@
13#include <net/netns/generic.h> 13#include <net/netns/generic.h>
14#include <net/rtnetlink.h> 14#include <net/rtnetlink.h>
15#include <net/lwtunnel.h> 15#include <net/lwtunnel.h>
16#include <net/dst_cache.h>
16 17
17#if IS_ENABLED(CONFIG_IPV6) 18#if IS_ENABLED(CONFIG_IPV6)
18#include <net/ipv6.h> 19#include <net/ipv6.h>
@@ -85,11 +86,6 @@ struct ip_tunnel_prl_entry {
85 struct rcu_head rcu_head; 86 struct rcu_head rcu_head;
86}; 87};
87 88
88struct ip_tunnel_dst {
89 struct dst_entry __rcu *dst;
90 __be32 saddr;
91};
92
93struct metadata_dst; 89struct metadata_dst;
94 90
95struct ip_tunnel { 91struct ip_tunnel {
@@ -108,7 +104,7 @@ struct ip_tunnel {
108 int tun_hlen; /* Precalculated header length */ 104 int tun_hlen; /* Precalculated header length */
109 int mlink; 105 int mlink;
110 106
111 struct ip_tunnel_dst __percpu *dst_cache; 107 struct dst_cache dst_cache;
112 108
113 struct ip_tunnel_parm parms; 109 struct ip_tunnel_parm parms;
114 110
@@ -247,7 +243,6 @@ int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
247int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[], 243int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
248 struct ip_tunnel_parm *p); 244 struct ip_tunnel_parm *p);
249void ip_tunnel_setup(struct net_device *dev, int net_id); 245void ip_tunnel_setup(struct net_device *dev, int net_id);
250void ip_tunnel_dst_reset_all(struct ip_tunnel *t);
251int ip_tunnel_encap_setup(struct ip_tunnel *t, 246int ip_tunnel_encap_setup(struct ip_tunnel *t,
252 struct ip_tunnel_encap *ipencap); 247 struct ip_tunnel_encap *ipencap);
253 248