netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: pablo@netfilter.org, fw@strlen.de, netfilter-devel@vger.kernel.org
Cc: ap420073@gmail.com
Subject: [PATCH nf 2/4] netfilter: nft_flow_offload: do not make un-established tcp flow_offload session.
Date: Sat, 27 Apr 2019 01:53:27 +0900	[thread overview]
Message-ID: <20190426165327.3533-1-ap420073@gmail.com> (raw)

nft_flow_offload_eval() makes flow_offload session but it doesn't check
tcp state.
So, it can make un-ESTABLISHED tcp flow offload session such as SYN-RECV.
But, this is not a normal case.

Fixes: a3c90f7a2323 ("netfilter: nf_tables: flow offload expression")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 net/netfilter/nft_flow_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
index ff50bc1b144f..8538ddf9c6bf 100644
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -84,6 +84,9 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
 
 	switch (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum) {
 	case IPPROTO_TCP:
+		if (ct->proto.tcp.state != TCP_CONNTRACK_ESTABLISHED)
+			goto out;
+		break;
 	case IPPROTO_UDP:
 		break;
 	default:
-- 
2.17.1


             reply	other threads:[~2019-04-26 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 16:53 Taehee Yoo [this message]
2019-04-26 17:03 ` [PATCH nf 2/4] netfilter: nft_flow_offload: do not make un-established tcp flow_offload session Pablo Neira Ayuso
2019-04-26 17:48   ` Taehee Yoo
2019-04-26 19:02     ` Pablo Neira Ayuso
2019-04-27  9:21       ` Taehee Yoo

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=20190426165327.3533-1-ap420073@gmail.com \
    --to=ap420073@gmail.com \
    --cc=fw@strlen.de \
    --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).