]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Sep 2017 12:05:48 +0000 (14:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Sep 2017 12:05:48 +0000 (14:05 +0200)
added patches:
ip6_gre-fix-endianness-errors-in-ip6gre_err.patch

queue-3.18/ip6_gre-fix-endianness-errors-in-ip6gre_err.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/ip6_gre-fix-endianness-errors-in-ip6gre_err.patch b/queue-3.18/ip6_gre-fix-endianness-errors-in-ip6gre_err.patch
new file mode 100644 (file)
index 0000000..298606b
--- /dev/null
@@ -0,0 +1,43 @@
+From d1e158e2d7a0a91110b206653f0e02376e809150 Mon Sep 17 00:00:00 2001
+From: Sabrina Dubroca <sd@queasysnail.net>
+Date: Wed, 4 Feb 2015 15:25:09 +0100
+Subject: ip6_gre: fix endianness errors in ip6gre_err
+
+From: Sabrina Dubroca <sd@queasysnail.net>
+
+commit d1e158e2d7a0a91110b206653f0e02376e809150 upstream.
+
+info is in network byte order, change it back to host byte order
+before use. In particular, the current code sets the MTU of the tunnel
+to a wrong (too big) value.
+
+Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
+Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
+Acked-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/ipv6/ip6_gre.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/ipv6/ip6_gre.c
++++ b/net/ipv6/ip6_gre.c
+@@ -421,7 +421,7 @@ static void ip6gre_err(struct sk_buff *s
+               if (code == ICMPV6_HDR_FIELD)
+                       teli = ip6_tnl_parse_tlv_enc_lim(skb, skb->data);
+-              if (teli && teli == info - 2) {
++              if (teli && teli == be32_to_cpu(info) - 2) {
+                       tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli];
+                       if (tel->encap_limit == 0) {
+                               net_warn_ratelimited("%s: Too small encapsulation limit or routing loop in tunnel!\n",
+@@ -433,7 +433,7 @@ static void ip6gre_err(struct sk_buff *s
+               }
+               break;
+       case ICMPV6_PKT_TOOBIG:
+-              mtu = info - offset;
++              mtu = be32_to_cpu(info) - offset;
+               if (mtu < IPV6_MIN_MTU)
+                       mtu = IPV6_MIN_MTU;
+               t->dev->mtu = mtu;
index a138bc0c8dacbffb19ce1b8cc454039dc51e8697..ef09cf0ff600bdf8c19ca268f4ab8715b1f7fdb5 100644 (file)
@@ -6,3 +6,4 @@ ipv6-fix-memory-leak-with-multiple-tables-during-netns-destruction.patch
 ipv6-fix-typo-in-fib6_net_exit.patch
 f2fs-check-hot_data-for-roll-forward-recovery.patch
 revert-usb-musb-fix-tx-fifo-flush-handling-again.patch
+ip6_gre-fix-endianness-errors-in-ip6gre_err.patch