From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
Michal Kubecek <mkubecek@suse.cz>
Cc: netfilter-devel@vger.kernel.org, linux-sctp@vger.kernel.org,
Vlad Yasevich <vyasevich@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [RFC PATCH -next] netfilter: nf_ct_sctp: validate vtag for new conntrack entries
Date: Thu, 26 Nov 2015 12:52:10 +0000 [thread overview]
Message-ID: <5657007A.40303@gmail.com> (raw)
In-Reply-To: <20151126095133.GA1612@salvia>
Em 26-11-2015 07:51, Pablo Neira Ayuso escreveu:
> On Wed, Nov 25, 2015 at 09:58:30PM +0100, Michal Kubecek wrote:
>> On Wed, Nov 25, 2015 at 06:20:46PM -0200, Marcelo Ricardo Leitner wrote:
>>> Em 25-11-2015 17:42, Pablo Neira Ayuso escreveu:
>>>>
>>>> Any specific reason ...
>>>>
>>>> not to have this enable by default?
>>>> to have a sysctl switch to enable/disable this?
>>>>
>>>> Thanks.
>>>
>>> Yes, because it can't be used in routers in the middle. That is,
>>> unless it's a common hop with the initial path..
>>> If it's enabled and this router doesn't see the initial handshake,
>>> it won't allow heartbeats to pass and will block all secondary
>>> paths.
>>>
>>> So if one is already using commit d7ee35190427 and this went on by
>>> default, it would break his/her setup.
>>
>> This essentially means anyone using SCTP multihoming and conntrack based
>> rules as commit db29a9508a92 ("netfilter: conntrack: disable generic
>> tracking for known protocols") enforces using the helper. This is where
>> the need for basic multihoming support came from: our customer was using
>> SCTP multihoming through a firewall with connection tracking but without
>> helper (so that only IP addresses were used to match the conntrack); the
>> security fix prevented them from doing that.
>
> I would really like to see some scrutiny on the SCTP to get it
> embedded into nf_conntrack.
>
> Similar things with other existing protocols that are supported, where
> you need to modprobe the protocol to get support for this.
>
> I think this existing behaviour is an anachronism.
This is not like an extension to SCTP, like a new protocol on top of it.
It's just how SCTP works on its own.
We can compare the creation of conntrack entries based on heartbeats
with tcp_loose switch, which allows picking up already established
connections. Conntrack entries based on heartbeats are somewhat like
that, it's for paths that you didn't/can't see the handshake.
Then, this patch takes advantage that all SCTP associations have an ID
(vtag) associated with it and makes it possible to only allow these
secondary paths if such vtag is already known by this host, in an
attempt to not be too loose.
This is kind of orthogonal with FTP expected data connections: we can't
know any of the addresses that will be used for the other paths, but we
expect that new paths will be used.
So if you see conntrack running at the host that is running the
application, these secondary conntracks would be like RELATED conntrack
entries, because we can check if the vtag is known or not and have an
indication that it's related to something that is already there. But if
you see conntrack running on a router somewhere out there, it's just
picking up an already established connection, because it has no idea of
the rest of the association. The former is the one this patch aims to
protect without interfering with the last.
Does that help somehow?
Marcelo
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
Michal Kubecek <mkubecek@suse.cz>
Cc: netfilter-devel@vger.kernel.org, linux-sctp@vger.kernel.org,
Vlad Yasevich <vyasevich@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [RFC PATCH -next] netfilter: nf_ct_sctp: validate vtag for new conntrack entries
Date: Thu, 26 Nov 2015 10:52:10 -0200 [thread overview]
Message-ID: <5657007A.40303@gmail.com> (raw)
In-Reply-To: <20151126095133.GA1612@salvia>
Em 26-11-2015 07:51, Pablo Neira Ayuso escreveu:
> On Wed, Nov 25, 2015 at 09:58:30PM +0100, Michal Kubecek wrote:
>> On Wed, Nov 25, 2015 at 06:20:46PM -0200, Marcelo Ricardo Leitner wrote:
>>> Em 25-11-2015 17:42, Pablo Neira Ayuso escreveu:
>>>>
>>>> Any specific reason ...
>>>>
>>>> not to have this enable by default?
>>>> to have a sysctl switch to enable/disable this?
>>>>
>>>> Thanks.
>>>
>>> Yes, because it can't be used in routers in the middle. That is,
>>> unless it's a common hop with the initial path..
>>> If it's enabled and this router doesn't see the initial handshake,
>>> it won't allow heartbeats to pass and will block all secondary
>>> paths.
>>>
>>> So if one is already using commit d7ee35190427 and this went on by
>>> default, it would break his/her setup.
>>
>> This essentially means anyone using SCTP multihoming and conntrack based
>> rules as commit db29a9508a92 ("netfilter: conntrack: disable generic
>> tracking for known protocols") enforces using the helper. This is where
>> the need for basic multihoming support came from: our customer was using
>> SCTP multihoming through a firewall with connection tracking but without
>> helper (so that only IP addresses were used to match the conntrack); the
>> security fix prevented them from doing that.
>
> I would really like to see some scrutiny on the SCTP to get it
> embedded into nf_conntrack.
>
> Similar things with other existing protocols that are supported, where
> you need to modprobe the protocol to get support for this.
>
> I think this existing behaviour is an anachronism.
This is not like an extension to SCTP, like a new protocol on top of it.
It's just how SCTP works on its own.
We can compare the creation of conntrack entries based on heartbeats
with tcp_loose switch, which allows picking up already established
connections. Conntrack entries based on heartbeats are somewhat like
that, it's for paths that you didn't/can't see the handshake.
Then, this patch takes advantage that all SCTP associations have an ID
(vtag) associated with it and makes it possible to only allow these
secondary paths if such vtag is already known by this host, in an
attempt to not be too loose.
This is kind of orthogonal with FTP expected data connections: we can't
know any of the addresses that will be used for the other paths, but we
expect that new paths will be used.
So if you see conntrack running at the host that is running the
application, these secondary conntracks would be like RELATED conntrack
entries, because we can check if the vtag is known or not and have an
indication that it's related to something that is already there. But if
you see conntrack running on a router somewhere out there, it's just
picking up an already established connection, because it has no idea of
the rest of the association. The former is the one this patch aims to
protect without interfering with the last.
Does that help somehow?
Marcelo
next prev parent reply other threads:[~2015-11-26 12:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 19:13 [RFC PATCH -next] netfilter: nf_ct_sctp: validate vtag for new conntrack entries Marcelo Ricardo Leitner
2015-11-25 19:13 ` Marcelo Ricardo Leitner
2015-11-25 19:42 ` Pablo Neira Ayuso
2015-11-25 19:42 ` Pablo Neira Ayuso
2015-11-25 20:20 ` Marcelo Ricardo Leitner
2015-11-25 20:20 ` Marcelo Ricardo Leitner
2015-11-25 20:58 ` Michal Kubecek
2015-11-25 20:58 ` Michal Kubecek
2015-11-26 9:51 ` Pablo Neira Ayuso
2015-11-26 9:51 ` Pablo Neira Ayuso
2015-11-26 12:52 ` Marcelo Ricardo Leitner [this message]
2015-11-26 12:52 ` Marcelo Ricardo Leitner
2015-11-26 14:15 ` Patrick McHardy
2015-11-26 14:33 ` Florian Westphal
2015-11-26 14:33 ` Florian Westphal
2015-11-26 14:49 ` Patrick McHardy
2015-11-26 15:07 ` Florian Westphal
2015-11-26 15:07 ` Florian Westphal
2015-11-26 15:11 ` Patrick McHardy
2015-11-26 15:12 ` Pablo Neira Ayuso
2015-11-26 15:12 ` Pablo Neira Ayuso
2015-11-26 15:24 ` Patrick McHardy
2015-11-26 15:54 ` Pablo Neira Ayuso
2015-11-26 15:54 ` Pablo Neira Ayuso
2015-11-26 16:02 ` Patrick McHardy
2015-11-26 16:15 ` Pablo Neira Ayuso
2015-11-26 16:15 ` Pablo Neira Ayuso
2015-11-26 16:25 ` Patrick McHardy
2015-11-26 16:43 ` Pablo Neira Ayuso
2015-11-26 16:43 ` Pablo Neira Ayuso
2015-11-26 16:53 ` Patrick McHardy
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=5657007A.40303@gmail.com \
--to=marcelo.leitner@gmail.com \
--cc=linux-sctp@vger.kernel.org \
--cc=mkubecek@suse.cz \
--cc=netfilter-devel@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pablo@netfilter.org \
--cc=vyasevich@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.