From: Florian Westphal <fw@strlen.de>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Florian Westphal <fw@strlen.de>,
Pablo Neira Ayuso <pablo@netfilter.org>,
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:59:34 +0100 [thread overview]
Message-ID: <20190303195934.r35rgo24dobmpz3y@breakpoint.cc> (raw)
In-Reply-To: <alpine.DEB.2.20.1903032035350.19344@blackhole.kfki.hu>
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> wrote:
> > 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).
>
> Sorry, but I don't see where is the outstanding data. Up to the RST and
> the challenge ACK there's no missing ACK. The RST hasn't got wrong seq
> because it's in the window. The RST flag is not counted. What do I miss?
There is no outstanding data, but conntrack thinks there is.
If we have this:
seq 100 ack x len 100
seq 200 rst x len 0
Then rst is accepted immediately and we move to CLOSE.
When we get this:
seq 100 ack x len 100
seq 210 rst x len 0
Then from conntrack point of view, we're 10 bytes "short" because td_end
is 200, and new sequence is 210. So we hit this:
if (after(end, sender->td_end)) {
sender->td_end = end;
sender->flags |= IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED;
}
in tcp_in_window().
> If the conntrack timeout is not the ESTABLISHED one after the challenge
> ACK is seen, that's perfect.
The challenge ACK will use last in-sequence number as seen by the
receiver, so 200 in this case.
If it would be 210, then that would mean that conntrack, for some
reason, did not see those 10 bytes, but the real endpoint did.
And in that case we'd move back to full ESTABLISHED timeout.
next prev parent reply other threads:[~2019-03-03 19:59 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
2019-03-03 19:46 ` Jozsef Kadlecsik
2019-03-03 19:59 ` Florian Westphal [this message]
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=20190303195934.r35rgo24dobmpz3y@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).