]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: reset tcp maxwin on re-register
authorFlorian Westphal <fw@strlen.de>
Fri, 24 Aug 2018 21:22:08 +0000 (23:22 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Sep 2018 23:29:24 +0000 (01:29 +0200)
commit9bd81bd194d2b5891d58a6c4f788fee9ce6e7d92
treefc083aac1dde0e5f89e969d14c7ae2adee4b2191
parent550703421b3fd18bd0b8dbd7d97ec57eac7e6cdc
netfilter: conntrack: reset tcp maxwin on re-register

Doug Smythies says:
  Sometimes it is desirable to temporarily disable, or clear,
  the iptables rule set on a computer being controlled via a
  secure shell session (SSH). While unwise on an internet facing
  computer, I also do it often on non-internet accessible computers
  while testing. Recently, this has become problematic, with the
  SSH session being dropped upon re-load of the rule set.

The problem is that when all rules are deleted, conntrack hooks get
unregistered.

In case the rules are re-added later, its possible that tcp window
has moved far enough so that all packets are considered invalid (out of
window) until entry expires (which can take forever, default
established timeout is 5 days).

Fix this by clearing maxwin of existing tcp connections on register.

v2: don't touch entries on hook removal.
v3: remove obsolete expiry check.

Reported-by: Doug Smythies <dsmythies@telus.net>
Fixes: 28c04e80b006e8 ("netfilter: conntrack: do not enable connection tracking unless needed")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_proto.c