From: Patrick McHardy <kaber@trash.net>
To: Florian Westphal <fw@strlen.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: x_tables: add context to know if extension runs from nft_compat
Date: Mon, 2 Mar 2015 13:27:05 +0000 [thread overview]
Message-ID: <20150302132657.GR6142@acer.localdomain> (raw)
In-Reply-To: <20150302131940.GA7418@breakpoint.cc>
On 02.03, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > 2) TCPMSS. Relax the checking when used from nft_compat and make sure
> > that we skip !syn packets in case userspace provides a wrong
> > configuration.
> > diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
> > index e762de5..3b9761f 100644
> > --- a/net/netfilter/xt_TCPMSS.c
> > +++ b/net/netfilter/xt_TCPMSS.c
> > @@ -97,6 +97,9 @@ tcpmss_mangle_packet(struct sk_buff *skb,
> > if (!skb_make_writable(skb, skb->len))
> > return -1;
> >
> > + if (unlikely(!tcph->syn))
> > + return 0;
> > +
> > len = skb->len - tcphoff;
>
> Applying this to my copy of nf-next would insert this test before
> tcph is set up.
I actually don't think the test is necessary at all. Since we
don't check the protocol with nft, any packet with that bit set
will pass. It will most likely fail or corrupt the packet, but
why should we care? It won't crash and with nft its the
responsibility of userspace to take care of using the extension
correctly.
next prev parent reply other threads:[~2015-03-02 13:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 13:11 [PATCH nf-next] netfilter: x_tables: add context to know if extension runs from nft_compat Pablo Neira Ayuso
2015-03-02 13:19 ` Patrick McHardy
2015-03-02 14:03 ` Pablo Neira Ayuso
2015-03-02 14:19 ` Patrick McHardy
2015-03-02 14:30 ` Pablo Neira Ayuso
2015-03-02 14:36 ` Patrick McHardy
2015-03-02 15:21 ` Pablo Neira Ayuso
2015-03-02 15:30 ` Patrick McHardy
2015-03-02 13:19 ` Florian Westphal
2015-03-02 13:27 ` Patrick McHardy [this message]
2015-03-02 13:58 ` Pablo Neira Ayuso
2015-03-02 13:50 ` Pablo Neira Ayuso
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=20150302132657.GR6142@acer.localdomain \
--to=kaber@trash.net \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).