netfilter: xt_TCPMSS: Fix missing fragmentation handling

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>
This commit is contained in:
Phil Oester 2013-06-12 10:58:20 +02:00 committed by Pablo Neira Ayuso
parent 70d19f805f
commit b396966c46
1 changed files with 4 additions and 0 deletions

View File

@ -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;