linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: [ 21/46] ipv6: drop packets with multiple fragmentation headers
Date: Thu, 12 Sep 2013 10:58:32 -0700	[thread overview]
Message-ID: <20130912175723.336686706@linuxfoundation.org> (raw)
In-Reply-To: <20130912175721.001906199@linuxfoundation.org>

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

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

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

[ Upstream commit f46078cfcd77fa5165bf849f5e568a7ac5fa569c ]

It is not allowed for an ipv6 packet to contain multiple fragmentation
headers. So discard packets which were already reassembled by
fragmentation logic and send back a parameter problem icmp.

The updates for RFC 6980 will come in later, I have to do a bit more
research here.

Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/ipv6.h  |    1 +
 net/ipv6/reassembly.c |    5 +++++
 2 files changed, 6 insertions(+)

--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -101,6 +101,7 @@ struct inet6_skb_parm {
 #define IP6SKB_FORWARDED	2
 #define IP6SKB_REROUTED		4
 #define IP6SKB_ROUTERALERT	8
+#define IP6SKB_FRAGMENTED      16
 };
 
 #define IP6CB(skb)	((struct inet6_skb_parm*)((skb)->cb))
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -490,6 +490,7 @@ static int ip6_frag_reasm(struct frag_qu
 	ipv6_hdr(head)->payload_len = htons(payload_len);
 	ipv6_change_dsfield(ipv6_hdr(head), 0xff, ecn);
 	IP6CB(head)->nhoff = nhoff;
+	IP6CB(head)->flags |= IP6SKB_FRAGMENTED;
 
 	/* Yes, and fold redundant checksum back. 8) */
 	if (head->ip_summed == CHECKSUM_COMPLETE)
@@ -524,6 +525,9 @@ static int ipv6_frag_rcv(struct sk_buff
 	struct net *net = dev_net(skb_dst(skb)->dev);
 	int evicted;
 
+	if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED)
+		goto fail_hdr;
+
 	IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS);
 
 	/* Jumbo payload inhibits frag. header */
@@ -544,6 +548,7 @@ static int ipv6_frag_rcv(struct sk_buff
 				 ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS);
 
 		IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb);
+		IP6CB(skb)->flags |= IP6SKB_FRAGMENTED;
 		return 1;
 	}
 



  parent reply	other threads:[~2013-09-12 18:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 17:58 [ 00/46] 3.10.12-stable review Greg Kroah-Hartman
2013-09-12 17:58 ` [ 01/46] htb: fix sign extension bug Greg Kroah-Hartman
2013-09-12 17:58 ` [ 02/46] net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails Greg Kroah-Hartman
2013-09-12 17:58 ` [ 03/46] net: check net.core.somaxconn sysctl values Greg Kroah-Hartman
2013-09-12 17:58 ` [ 04/46] macvlan: validate flags Greg Kroah-Hartman
2013-09-12 17:58 ` [ 05/46] neighbour: populate neigh_parms on alloc before calling ndo_neigh_setup Greg Kroah-Hartman
2013-09-12 17:58 ` [ 06/46] bonding: modify only neigh_parms owned by us Greg Kroah-Hartman
2013-09-12 17:58 ` [ 07/46] fib_trie: remove potential out of bound access Greg Kroah-Hartman
2013-09-12 17:58 ` [ 08/46] bridge: dont try to update timers in case of broken MLD queries Greg Kroah-Hartman
2013-09-12 17:58 ` [ 09/46] tcp: cubic: fix overflow error in bictcp_update() Greg Kroah-Hartman
2013-09-12 17:58 ` [ 10/46] tcp: cubic: fix bug in bictcp_acked() Greg Kroah-Hartman
2013-09-12 17:58 ` [ 11/46] ipv6: dont stop backtracking in fib6_lookup_1 if subtree does not match Greg Kroah-Hartman
2013-09-12 17:58 ` [ 12/46] ip_gre: fix ipgre_header to return correct offset MIME-Version: 1.0 Greg Kroah-Hartman
2013-09-12 17:58 ` [ 13/46] 8139cp: Fix skb leak in rx_status_loop failure path Greg Kroah-Hartman
2013-09-12 17:58 ` [ 14/46] rtnetlink: Fix inverted check in ndo_dflt_fdb_del() Greg Kroah-Hartman
2013-09-12 17:58 ` [ 15/46] genl: Fix genl dumpit() locking Greg Kroah-Hartman
2013-09-12 17:58 ` [ 16/46] genl: Hold reference on correct module while netlink-dump Greg Kroah-Hartman
2013-09-12 17:58 ` [ 17/46] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id Greg Kroah-Hartman
2013-09-12 17:58 ` [ 18/46] rtnetlink: rtnl_bridge_getlink: Call nlmsg_find_attr() with ifinfomsg header Greg Kroah-Hartman
2013-09-12 17:58 ` [ 19/46] tun: signedness bug in tun_get_user() Greg Kroah-Hartman
2013-09-12 17:58 ` [ 20/46] ipv6: remove max_addresses check from ipv6_create_tempaddr Greg Kroah-Hartman
2013-09-12 17:58 ` Greg Kroah-Hartman [this message]
2013-09-12 17:58 ` [ 22/46] tcp: set timestamps for restored skb-s Greg Kroah-Hartman
2013-09-12 17:58 ` [ 23/46] packet: restore packet statistics tp_packets to include drops Greg Kroah-Hartman
2013-09-12 17:58 ` [ 24/46] bridge: Use the correct bit length for bitmap functions in the VLAN code Greg Kroah-Hartman
2013-09-12 17:58 ` [ 25/46] net_sched: restore "linklayer atm" handling Greg Kroah-Hartman
2013-09-12 17:58 ` [ 26/46] sfc: Fix lookup of default RX MAC filters when steered using ethtool Greg Kroah-Hartman
2013-09-12 17:58 ` [ 27/46] be2net: fix disabling TX in be_close() Greg Kroah-Hartman
2013-09-12 17:58 ` [ 28/46] net: usb: Add HP hs2434 device to ZLP exception table Greg Kroah-Hartman
2013-09-12 17:58 ` [ 29/46] tcp: initialize rcv_tstamp for restored sockets Greg Kroah-Hartman
2013-09-12 17:58 ` [ 30/46] tcp: dont apply tsoffset if rcv_tsecr is zero Greg Kroah-Hartman
2013-09-12 17:58 ` [ 31/46] ipv4: sendto/hdrincl: dont use destination address found in header Greg Kroah-Hartman
2013-09-12 17:58 ` [ 32/46] ipv6: Dont depend on per socket memory for neighbour discovery messages Greg Kroah-Hartman
2013-09-12 17:58 ` [ 33/46] tcp: tcp_make_synack() should use sock_wmalloc Greg Kroah-Hartman
2013-09-12 17:58 ` [ 34/46] tipc: set sk_err correctly when connection fails Greg Kroah-Hartman
2013-09-12 17:58 ` [ 35/46] net: revert 8728c544a9c ("net: dev_pick_tx() fix") Greg Kroah-Hartman
2013-09-12 17:58 ` [ 36/46] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay Greg Kroah-Hartman
2013-09-12 17:58 ` [ 37/46] ICMPv6: treat dest unreachable codes 5 and 6 as EACCES, not EPROTO Greg Kroah-Hartman
2013-09-12 17:58 ` [ 38/46] tg3: Dont turn off led on 5719 serdes port 0 Greg Kroah-Hartman
2013-09-12 17:58 ` [ 39/46] vhost_net: poll vhost queue after marking DMA is done Greg Kroah-Hartman
2013-09-12 17:58 ` [ 40/46] ipv6: fix null pointer dereference in __ip6addrlbl_add Greg Kroah-Hartman
2013-09-12 17:58 ` [ 41/46] net: ipv6: tcp: fix potential use after free in tcp_v6_do_rcv Greg Kroah-Hartman
2013-09-12 17:58 ` [ 42/46] net: mvneta: properly disable HW PHY polling and ensure adjust_link() works Greg Kroah-Hartman
2013-09-12 17:58 ` [ 43/46] crypto: xor - Check for osxsave as well as avx in crypto/xor Greg Kroah-Hartman
2013-09-12 17:58 ` [ 44/46] drivers/rtc/rtc-max77686.c: Fix wrong register Greg Kroah-Hartman
2013-09-12 17:58 ` [ 45/46] mwifiex: do not create AP and P2P interfaces upon driver loading Greg Kroah-Hartman
2013-09-12 17:58 ` [ 46/46] ARM: at91: dt: sam9260: add i2c gpio pinctrl Greg Kroah-Hartman
2013-09-12 22:35 ` [ 00/46] 3.10.12-stable review Guenter Roeck
2013-09-12 23:07   ` Greg Kroah-Hartman
2013-09-13 23:02 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130912175723.336686706@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).