From: Jeremy Sowden <jeremy@azazel.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>,
Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: Re: [libnetfilter_conntrack PATCH] conntrack: increase the length of `l4proto_map`
Date: Wed, 11 Jan 2023 18:34:24 +0000 [thread overview]
Message-ID: <Y78BMDGFGJow0Hcz@celephais.dreamlands> (raw)
In-Reply-To: <Y77+FQ06j+gRFURI@salvia>
[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]
On 2023-01-11, at 19:21:09 +0100, Pablo Neira Ayuso wrote:
> On Wed, Jan 11, 2023 at 07:08:18PM +0100, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > On Fri, Dec 23, 2022 at 12:38:06PM +0000, Jeremy Sowden wrote:
> > > > With addition of MPTCP `IPPROTO_MAX` is greater than 256, so extend the
> > > > array to account for the new upper bound.
> > >
> > > Applied, thanks.
> > >
> > > I don't expect we will ever see IPPROTO_MPTCP in this path though.
> > > To my understanding, this definition is targeted at the
> > > setsockopt/getsockopt() use-case. IP headers and the ctnetlink
> > > interface also assumes 8-bits protocol numbers.
> >
> > Yes, this is an uapi thing:
> >
> > socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); vs.
> > socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP);
> >
> > Only second version results in a multipath-tcp aware socket.
> >
> > If mptcp is active (both peers need to support it), tcp frames will
> > have an 'mptcp' option, but its still tcp (6) on wire.
>
> Thanks for confirming.
>
> Probably I'll post a patch to add an internal __IPPROTO_MAX definition
> that sticks to 255, so libnetfilter_conntrack maps don't start
> increasing if more IPPROTO_* definitions show up in the future for the
> setsockopt/getsockopt interface.
>
Fbm.
Just to be clear, the problem I wanted to fix (why I didn't put this
in the commit message I don't know) was this from bsf.c (ll. 473ff.):
for (i = 0; i < IPPROTO_MAX; i++) {
if (test_bit(i, f->l4proto_map)) {
j += nfct_bsf_cmp_k_stack(this, i, jt - j, j, s);
}
}
where we are currently reading past the end of array.
J.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-01-11 18:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-23 12:38 [libnetfilter_conntrack PATCH] conntrack: increase the length of `l4proto_map` Jeremy Sowden
2023-01-11 18:03 ` Pablo Neira Ayuso
2023-01-11 18:08 ` Florian Westphal
2023-01-11 18:21 ` Pablo Neira Ayuso
2023-01-11 18:34 ` Jeremy Sowden [this message]
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=Y78BMDGFGJow0Hcz@celephais.dreamlands \
--to=jeremy@azazel.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).