netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: conntrack: tcp: only close if RST matches exact sequence
Date: Sun, 3 Mar 2019 20:16:29 +0100	[thread overview]
Message-ID: <20190303191629.jl6hrv4yo6ctqbt4@breakpoint.cc> (raw)
In-Reply-To: <alpine.DEB.2.20.1903031715240.18380@blackhole.kfki.hu>

Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> wrote:
> > @Jozsef, if you could also have a look to confirm if you see any
> > issue, this looks fine to me and we, of course, can revert this in
> > this this tightening in RST tracking has any side issue. Thanks!
> 
> The only problem I see is this part:
> 
> > > If the peer sends a challenge ack, connection timeout will be reset.
> 
> RFC5961 does not discuss the issue of the timeout when the challenge ack 
> is sent and get lost, never reaches the destination. Like in this 
> case:
> 
> non RFC5961 client 	firewall	our firewall	RFC5961 server
> in-window RST ->
> 			ct dropped	ct kept,
> 					CLOSED timeout
> 							<- challenge ack
> 					ct kept,
> 					ESTABLISHED timeout
> 			ack dropped


The ESTABLISHED timeout is 5 minutes because of missing ACKs
(outstanding data) in this case though (the RST has "wrong" sequence
number, so the conntrack is flagged accordingly until something
acks the data).

> I think we should keep the CLOSED timeout when the challenge ack is 
> detected, which probably needs a new flag (IP_CT_EXP_CHALLENGE_ACK is for 
> SYN ACK challenges).

I think its fine as is with the unacknowledged data timeout, but it
should be easy to keep the 10 seconds using the flag you suggest).

I think we can even reuse the EXP_CHALLENGE_ACK for this.

> In my opinion it was a very bad design decision of RFC5961 that there's no 
> TCP option/flag to signal to the peer that the sender speaks the RFC5961 
> flavour.

I think its fine, we would have the same problem if the RST was lost
before reaching us.

  reply	other threads:[~2019-03-03 19:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 16:09 [PATCH nf-next] netfilter: conntrack: tcp: only close if RST matches exact sequence Florian Westphal
2019-03-01 13:24 ` Pablo Neira Ayuso
2019-03-03 16:50   ` Jozsef Kadlecsik
2019-03-03 19:16     ` Florian Westphal [this message]
2019-03-03 19:46       ` Jozsef Kadlecsik
2019-03-03 19:59         ` Florian Westphal
2019-03-03 20:44           ` Jozsef Kadlecsik

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=20190303191629.jl6hrv4yo6ctqbt4@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=kadlec@blackhole.kfki.hu \
    --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).