netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] document danger of '-j REJECT'ing of '-m state INVALID' packets
@ 2020-05-09  5:22 Maciej Żenczykowski
  2020-05-09 10:52 ` Jan Engelhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Maciej Żenczykowski @ 2020-05-09  5:22 UTC (permalink / raw)
  To: Maciej Żenczykowski, Pablo Neira Ayuso, Florian Westphal
  Cc: Linux Network Development Mailing List,
	Netfilter Development Mailing List

From: Maciej Żenczykowski <maze@google.com>

This appears to be a common, but hard to debug, misconfiguration.

Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 extensions/libip6t_REJECT.man | 15 +++++++++++++++
 extensions/libipt_REJECT.man  | 15 +++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/extensions/libip6t_REJECT.man b/extensions/libip6t_REJECT.man
index 0030a51f..b6474811 100644
--- a/extensions/libip6t_REJECT.man
+++ b/extensions/libip6t_REJECT.man
@@ -30,3 +30,18 @@ TCP RST packet to be sent back.  This is mainly useful for blocking
 hosts (which won't accept your mail otherwise).
 \fBtcp\-reset\fP
 can only be used with kernel versions 2.6.14 or later.
+.PP
+\fIWarning:\fP if you are using connection tracking and \fBACCEPT\fP'ing
+\fBESTABLISHED\fP (and possibly \fBRELATED\fP) state packets, do not
+indiscriminately \fBREJECT\fP (especially with \fITCP RST\fP) \fBINVALID\fP
+state packets.  Sometimes naturally occuring packet reordering will result
+in packets being considered \fBINVALID\fP and the generated \fITCP RST\fP
+will abort an otherwise healthy connection.
+.P
+Suggested use:
+.br
+    -A INPUT -m state ESTABLISHED,RELATED -j ACCEPT
+.br
+    -A INPUT -m state INVALID -j DROP
+.br
+(and -j REJECT rules go here at the end)
diff --git a/extensions/libipt_REJECT.man b/extensions/libipt_REJECT.man
index 8a360ce7..d0f0f19b 100644
--- a/extensions/libipt_REJECT.man
+++ b/extensions/libipt_REJECT.man
@@ -30,3 +30,18 @@ TCP RST packet to be sent back.  This is mainly useful for blocking
 hosts (which won't accept your mail otherwise).
 .IP
 (*) Using icmp\-admin\-prohibited with kernels that do not support it will result in a plain DROP instead of REJECT
+.PP
+\fIWarning:\fP if you are using connection tracking and \fBACCEPT\fP'ing
+\fBESTABLISHED\fP (and possibly \fBRELATED\fP) state packets, do not
+indiscriminately \fBREJECT\fP (especially with \fITCP RST\fP) \fBINVALID\fP
+state packets.  Sometimes naturally occuring packet reordering will result
+in packets being considered \fBINVALID\fP and the generated \fITCP RST\fP
+will abort an otherwise healthy connection.
+.P
+Suggested use:
+.br
+    -A INPUT -m state ESTABLISHED,RELATED -j ACCEPT
+.br
+    -A INPUT -m state INVALID -j DROP
+.br
+(and -j REJECT rules go here at the end)
-- 
2.26.2.645.ge9eca65c58-goog


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-05-13 16:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09  5:22 [PATCH] document danger of '-j REJECT'ing of '-m state INVALID' packets Maciej Żenczykowski
2020-05-09 10:52 ` Jan Engelhardt
2020-05-09 17:45   ` Maciej Żenczykowski
2020-05-09 18:02     ` Maciej Żenczykowski
2020-05-09 21:17     ` [PATCH] doc: document danger of applying REJECT to INVALID CTs Jan Engelhardt
2020-05-09 21:28       ` Maciej Żenczykowski
2020-05-09 21:31         ` Maciej Żenczykowski
2020-05-12 21:00         ` [PATCH v2] " Jan Engelhardt
2020-05-12 21:25           ` Maciej Żenczykowski
2020-05-13  4:39           ` Benjamin Poirier
2020-05-13  9:17             ` [PATCH v3] " Jan Engelhardt
2020-05-13  9:28               ` Maciej Żenczykowski
2020-05-13  9:39                 ` [PATCH v4] " Jan Engelhardt
2020-05-13 16:29                   ` Maciej Żenczykowski

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).