mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yyxRoy <yyxroy22@gmail.com>
To: fw@strlen.de
Cc: 979093444@qq.com, coreteam@netfilter.org, davem@davemloft.net,
	edumazet@google.com, gregkh@linuxfoundation.org,
	kadlec@blackhole.kfki.hu, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, pabeni@redhat.com,
	pablo@netfilter.org, yyxroy22@gmail.com
Subject: Re: [PATCH] netfilter: conntrack: tcp: do not lower timeout to CLOSE for in-window RSTs
Date: Wed, 10 Jul 2024 17:45:54 +0800	[thread overview]
Message-ID: <20240710094554.483075-1-979093444@qq.com> (raw)
In-Reply-To: <20240708141206.GA5340@breakpoint.cc>

On Mon, 8 Jul 2024 at 22:12, Florian Westphal <fw@strlen.de> wrote:
> We can track TTL/NH.
> We can track TCP timestamps.
> 
> But how would we use such extra information?
> E.g. what I we observe:
> 
> ACK, TTL 32
> ACK, TTL 31
> ACK, TTL 30
> ACK, TTL 29
> 
> ... will we just refuse to update TTL?
> If we reduce it, any attacker can shrink it to needed low value
> to prevent later RST from reaching end host.
> 
> If we don't, connection could get stuck on legit route change?
> What about malicious entities injecting FIN/SYN packets rather than RST?
> 
> If we have last ts.echo from remote side, we can make it harder, but
> what do if RST doesn't carry timestamp?
> 
> Could be perfectly legal when machine lost state, e.g. power-cycled.
> So we can't ignore such RSTs.

I fully agree with your considerations. There are indeed some challenges with the proposed methods of enhancing checks on RSTs of in-window sequence numbers, TTL, and timestamps.

However, we now have known that conntrack may be vulnerable to attacks and illegal state transitions when it receives in-window RSTs with incorrect TTL or data packets + RSTs. Is it possible to find better methods to mitigate these issues, as they may pose threats to Netfilter users?

Note: We have also tested other connection tracking frameworks (such as FreeBSD/OpenBSD PF). Also playing the roles as middleboxes, they only change the state of the connection when they receive an RST with the currently known precise sequence number, thus avoiding these attacks. Could Netfilter adopt similar measures or else to further mitigate these issues?

Thank you again for your time and for your efforts in maintaining the community's performance and security!

  reply	other threads:[~2024-07-10  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  4:00 yyxRoy
2024-07-05  9:43 ` Florian Westphal
2024-07-06 16:16   ` Jozsef Kadlecsik
2024-07-06 17:04     ` Florian Westphal
2024-07-08  8:59       ` yyxRoy
2024-07-08 14:12         ` Florian Westphal
2024-07-10  9:45           ` yyxRoy [this message]
2024-07-10 13:49             ` 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=20240710094554.483075-1-979093444@qq.com \
    --to=yyxroy22@gmail.com \
    --cc=979093444@qq.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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

all inboxes | Powered by JetHome®