All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: conntrack: Reset the max ACK flag on SYN in ignore state
@ 2021-04-20 12:24 Ali Abdallah
  2021-04-20 12:25 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Ali Abdallah @ 2021-04-20 12:24 UTC (permalink / raw)
  To: netfilter-devel

In ignore state, we let SYN goes in original, the server might respond
with RST/ACK, and that RST packet is erroneously dropped because of the
flag IP_CT_TCP_FLAG_MAXACK_SET being already set.

Signed-off-by: Ali Abdallah <aabdallah@suse.de>
---
 net/netfilter/nf_conntrack_proto_tcp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index ec23330687a5..02fab7a8ec92 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -963,6 +963,10 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct,
 
 			ct->proto.tcp.last_flags =
 			ct->proto.tcp.last_wscale = 0;
+			/* Reset the max ack flag so in case the server replies
+			 * with RST/ACK it will not be marked as an invalid rst.
+			 */
+			ct->proto.tcp.seen[dir].flags &= ~IP_CT_TCP_FLAG_MAXACK_SET;
 			tcp_options(skb, dataoff, th, &seen);
 			if (seen.flags & IP_CT_TCP_FLAG_WINDOW_SCALE) {
 				ct->proto.tcp.last_flags |=
-- 
2.26.2


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

* Re: [PATCH] netfilter: conntrack: Reset the max ACK flag on SYN in ignore state
  2021-04-20 12:24 [PATCH] netfilter: conntrack: Reset the max ACK flag on SYN in ignore state Ali Abdallah
@ 2021-04-20 12:25 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2021-04-20 12:25 UTC (permalink / raw)
  To: Ali Abdallah; +Cc: netfilter-devel

Ali Abdallah <ali.abdallah@suse.com> wrote:
> In ignore state, we let SYN goes in original, the server might respond
> with RST/ACK, and that RST packet is erroneously dropped because of the
> flag IP_CT_TCP_FLAG_MAXACK_SET being already set.

Acked-by: Florian Westphal <fw@strlen.de>

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

end of thread, other threads:[~2021-04-20 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 12:24 [PATCH] netfilter: conntrack: Reset the max ACK flag on SYN in ignore state Ali Abdallah
2021-04-20 12:25 ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.