All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()" has been added to the 4.4-stable tree
@ 2017-08-09  0:18 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-09  0:18 UTC (permalink / raw)
  To: sbrivio, davem, gregkh, sdubroca; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipv6-don-t-increase-ipstats_mib_fragfails-twice-in-ip6_fragment.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Aug  8 16:51:58 PDT 2017
From: Stefano Brivio <sbrivio@redhat.com>
Date: Mon, 24 Jul 2017 23:14:28 +0200
Subject: ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()

From: Stefano Brivio <sbrivio@redhat.com>


[ Upstream commit afce615aaabfbaad02550e75c0bec106dafa1adf ]

RFC 2465 defines ipv6IfStatsOutFragFails as:

	"The number of IPv6 datagrams that have been discarded
	 because they needed to be fragmented at this output
	 interface but could not be."

The existing implementation, instead, would increase the counter
twice in case we fail to allocate room for single fragments:
once for the fragment, once for the datagram.

This didn't look intentional though. In one of the two affected
affected failure paths, the double increase was simply a result
of a new 'goto fail' statement, introduced to avoid a skb leak.
The other path appears to be affected since at least 2.6.12-rc2.

Reported-by: Sabrina Dubroca <sdubroca@redhat.com>
Fixes: 1d325d217c7f ("ipv6: ip6_fragment: fix headroom tests and skb leak")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/ip6_output.c |    4 ----
 1 file changed, 4 deletions(-)

--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -647,8 +647,6 @@ int ip6_fragment(struct net *net, struct
 		*prevhdr = NEXTHDR_FRAGMENT;
 		tmp_hdr = kmemdup(skb_network_header(skb), hlen, GFP_ATOMIC);
 		if (!tmp_hdr) {
-			IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
-				      IPSTATS_MIB_FRAGFAILS);
 			err = -ENOMEM;
 			goto fail;
 		}
@@ -767,8 +765,6 @@ slow_path:
 		frag = alloc_skb(len + hlen + sizeof(struct frag_hdr) +
 				 hroom + troom, GFP_ATOMIC);
 		if (!frag) {
-			IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
-				      IPSTATS_MIB_FRAGFAILS);
 			err = -ENOMEM;
 			goto fail;
 		}


Patches currently in stable-queue which might be from sbrivio@redhat.com are

queue-4.4/ipv6-don-t-increase-ipstats_mib_fragfails-twice-in-ip6_fragment.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-09  0:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09  0:18 Patch "ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment()" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.