Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1520545

[PATCH 4.4 15/34] ip6_tunnel: fix ip6_tnl_lookup

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 15/34] ip6_tunnel: fix ip6_tnl_lookup
Date 2016-11-13 12:30 +0100
Message-ID <sD191-7Yp-83@gated-at.bofh.it> (permalink)
References <sD18Z-7Yp-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vadim Fedorenko <junk@yandex-team.ru>


[ Upstream commit 68d00f332e0ba7f60f212be74ede290c9f873bc5 ]

The commit ea3dc9601bda ("ip6_tunnel: Add support for wildcard tunnel
endpoints.") introduces support for wildcards in tunnels endpoints,
but in some rare circumstances ip6_tnl_lookup selects wrong tunnel
interface relying only on source or destination address of the packet
and not checking presence of wildcard in tunnels endpoints. Later in
ip6_tnl_rcv this packets can be dicarded because of difference in
ipproto even if fallback device have proper ipproto configuration.

This patch adds checks of wildcard endpoint in tunnel avoiding such
behavior

Fixes: ea3dc9601bda ("ip6_tunnel: Add support for wildcard tunnel endpoints.")
Signed-off-by: Vadim Fedorenko <junk@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/ip6_tunnel.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -246,6 +246,7 @@ ip6_tnl_lookup(struct net *net, const st
 	hash = HASH(&any, local);
 	for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) {
 		if (ipv6_addr_equal(local, &t->parms.laddr) &&
+		    ipv6_addr_any(&t->parms.raddr) &&
 		    (t->dev->flags & IFF_UP))
 			return t;
 	}
@@ -253,6 +254,7 @@ ip6_tnl_lookup(struct net *net, const st
 	hash = HASH(remote, &any);
 	for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) {
 		if (ipv6_addr_equal(remote, &t->parms.raddr) &&
+		    ipv6_addr_any(&t->parms.laddr) &&
 		    (t->dev->flags & IFF_UP))
 			return t;
 	}

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/34] 4.4.32-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 15/34] ip6_tunnel: fix ip6_tnl_lookup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 04/34] tcp: fix a compile error in DBGUNDO() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 07/34] tg3: Avoid NULL pointer dereference in tg3_io_error_detected() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 21/34] ipv4: disable BH in set_ping_group_range() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 32/34] drm/amdgpu: fix DP mode validation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 10/34] net/sched: act_vlan: Push skb->data to mac_header prior calling skb_vlan_*() functions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
    Re: [PATCH 4.4 10/34] net/sched: act_vlan: Push skb->data to  mac_header prior calling skb_vlan_*() functions Shmulik Ladkani <shmulik.ladkani@gmail.com> - 2016-11-14 08:10 +0100
  [PATCH 4.4 26/34] sctp: validate chunk len before actually using it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 03/34] tcp: fix wrong checksum calculation on MTU probing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:30 +0100
  [PATCH 4.4 12/34] packet: call fanout_release, while UNREGISTERING a netdev Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:40 +0100
  [PATCH 4.4 11/34] net: Add netdev all_adj_list refcnt propagation to fix panic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:40 +0100
  [PATCH 4.4 17/34] net: pktgen: remove rcu locking in pktgen_change_name() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-13 12:40 +0100
  Re: [PATCH 4.4 00/34] 4.4.32-stable review Guenter Roeck <linux@roeck-us.net> - 2016-11-13 21:50 +0100
  Re: [PATCH 4.4 00/34] 4.4.32-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-14 09:00 +0100
  Re: [PATCH 4.4 00/34] 4.4.32-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-11-14 17:50 +0100

csiph-web