stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch added to 3.12-stable] tunnel: Clear IPCB(skb)->opt before dst_link_failure called
@ 2016-04-20  6:30 Jiri Slaby
  2016-04-20  6:30 ` [patch added to 3.12-stable] net: jme: fix suspend/resume on JMC260 Jiri Slaby
                   ` (35 more replies)
  0 siblings, 36 replies; 40+ messages in thread
From: Jiri Slaby @ 2016-04-20  6:30 UTC (permalink / raw)
  To: stable; +Cc: Bernie Harris, David S . Miller, Jiri Slaby

From: Bernie Harris <bernie.harris@alliedtelesis.co.nz>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 5146d1f151122e868e594c7b45115d64825aee5f ]

IPCB may contain data from previous layers (in the observed case the
qdisc layer). In the observed scenario, the data was misinterpreted as
ip header options, which later caused the ihl to be set to an invalid
value (<5). This resulted in an infinite loop in the mips implementation
of ip_fast_csum.

This patch clears IPCB(skb)->opt before dst_link_failure can be called for
various types of tunnels. This change only applies to encapsulated ipv4
packets.

The code introduced in 11c21a30 which clears all of IPCB has been removed
to be consistent with these changes, and instead the opt field is cleared
unconditionally in ip_tunnel_xmit. The change in ip_tunnel_xmit applies to
SIT, GRE, and IPIP tunnels.

The relevant vti, l2tp, and pptp functions already contain similar code for
clearing the IPCB.

[js] backport to 3.12: no udp_tunnel there

Signed-off-by: Bernie Harris <bernie.harris@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ipv4/ip_tunnel.c  | 3 ++-
 net/ipv6/ip6_gre.c    | 2 ++
 net/ipv6/ip6_tunnel.c | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 6913e2fdc12c..d47c7ea98324 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -540,6 +540,8 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
 
 	inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
 
+	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
+
 	dst = tnl_params->daddr;
 	if (dst == 0) {
 		/* NBMA tunnel */
@@ -623,7 +625,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
 				tunnel->err_time + IPTUNNEL_ERR_TIMEO)) {
 			tunnel->err_count--;
 
-			memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
 			dst_link_failure(skb);
 		} else
 			tunnel->err_count = 0;
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index f719c51369fc..737af492ed75 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -787,6 +787,8 @@ static inline int ip6gre_xmit_ipv4(struct sk_buff *skb, struct net_device *dev)
 	__u32 mtu;
 	int err;
 
+	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
+
 	if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
 		encap_limit = t->parms.encap_limit;
 
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index f8a70a120e75..8883795462fe 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1063,6 +1063,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
 	__u32 mtu;
 	int err;
 
+	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
+
 	if ((t->parms.proto != IPPROTO_IPIP && t->parms.proto != 0) ||
 	    !ip6_tnl_xmit_ctl(t))
 		return -1;
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2016-04-27  9:09 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20  6:30 [patch added to 3.12-stable] tunnel: Clear IPCB(skb)->opt before dst_link_failure called Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: jme: fix suspend/resume on JMC260 Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] sctp: lack the check for ports in sctp_v6_cmp_addr Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: add "D-Link DWM-221 B1" device id Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: add Netgear AirCard 341U Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: add additional Sierra Wireless QMI devices Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: interface #11 in Sierra Wireless MC73xx is not QMI Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: add the second QMI/network interface for Sierra Wireless MC7305/MC7355 Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: Add support for Dell Wireless 5809e 4G Modem Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: Sierra Wireless MC73xx -> Sierra Wireless MC7304/MC7354 Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: add Sierra Wireless MC74xx/EM74xx Jiri Slaby
2016-04-20 10:14   ` Bjørn Mork
2016-04-27  9:08     ` Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: remove 1199:9070 device id Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: Add WeTelecom-WPD600N Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] net: qmi_wwan: Add SIMCom 7230E Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] Add Dell Wireless 5809e Gobi 4G HSPA+ Mobile Broadband Card (rev3) to qmi_wwan Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: add Sierra Wireless EM74xx device ID Jiri Slaby
2016-04-20 10:16   ` Bjørn Mork
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan: Added support for Gemalto's Cinterion PHxx WWAN interface Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] qmi_wwan/cdc_ether: move Novatel E371 (1410:9011) to qmi_wwan Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] ipv6: re-enable fragment header matching in ipv6_find_hdr Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] cdc_ncm: toggle altsetting to force reset before setup Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] usbnet: cleanup after bind() in probe() Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] udp6: fix UDP/IPv6 encap resubmit path Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] sh_eth: fix NULL pointer dereference in sh_eth_ring_format() Jiri Slaby
2016-04-20  6:30 ` [patch added to 3.12-stable] macvtap: always pass ethernet header in linear Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] net: Fix use after free in the recvmmsg exit path Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] mlx4: add missing braces in verify_qp_parameters Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] farsync: fix off-by-one bug in fst_add_one Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ath9k: fix buffer overrun for ar9287 Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] net: mvneta: enable change MAC address when interface is up Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] qlge: Fix receive packets drop Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ppp: take reference on channels netns Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] xfrm: Fix crash observed during device unregistration and decryption Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ipv4: l2tp: fix a potential issue in l2tp_ip_recv Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ipv6: l2tp: fix a potential issue in l2tp_ip6_recv Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ip6_tunnel: set rtnl_link_ops before calling register_netdevice Jiri Slaby
2016-04-20  6:31 ` [patch added to 3.12-stable] ipv6: Count in extension headers in skb->network_header Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).