netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 3/3] netfilter: xt_TCPMSS: Fix missing fragmentation handling
Date: Mon, 17 Jun 2013 21:34:39 +0200	[thread overview]
Message-ID: <1371497679-14314-4-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1371497679-14314-1-git-send-email-pablo@netfilter.org>

From: Phil Oester <kernel@linuxace.com>

Similar to commit bc6bcb59 ("netfilter: xt_TCPOPTSTRIP: fix
possible mangling beyond packet boundary"), add safe fragment
handling to xt_TCPMSS.

Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/xt_TCPMSS.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 6640a22..7011c71 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -57,6 +57,10 @@ tcpmss_mangle_packet(struct sk_buff *skb,
 	u16 newmss;
 	u8 *opt;
 
+	/* This is a fragment, no TCP header is available */
+	if (par->fragoff != 0)
+		return XT_CONTINUE;
+
 	if (!skb_make_writable(skb, skb->len))
 		return -1;
 
-- 
1.7.10.4


  parent reply	other threads:[~2013-06-17 19:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 19:34 [PATCH 0/3] netfilter fixes for net Pablo Neira Ayuso
2013-06-17 19:34 ` [PATCH 1/3] netfilter: xt_TCPOPTSTRIP: don't use tcp_hdr() Pablo Neira Ayuso
2013-06-17 20:30   ` Julian Anastasov
2013-06-17 19:34 ` [PATCH 2/3] netfilter: xt_TCPMSS: Fix IPv6 default MSS too Pablo Neira Ayuso
2013-06-17 19:34 ` Pablo Neira Ayuso [this message]
2013-06-17 21:03   ` [PATCH 3/3] netfilter: xt_TCPMSS: Fix missing fragmentation handling Julian Anastasov
2013-06-17 23:14 ` [PATCH 0/3] netfilter fixes for net David Miller

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=1371497679-14314-4-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.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).