Skip to contentSkip to conversation

Netfilter fixes for net

PATCH Applied Pablo Neira Ayuso 2 participants 3 messages May 3, 2023 – May 4, 2023

Subsystems (3)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

cover Netfilter fixes for net

Hi,

The following patchset contains one Netfilter fix:

1) Restore 'ct state untracked' matching with CONFIG_RETPOLINE=y, from Florian Westphal.

Please, pull these changes from:

git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git

Thanks.

----------------------------------------------------------------

The following changes since commit 6a341729fb31b4c5df9f74f24b4b1c98410c9b87:

af_packet: Don't send zero-byte data in packet_sendmsg_spkt(). (2023-05-03 09:20:18 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-23-05-03

for you to fetch changes up to f057b63bc11d86a98176de31b437e46789f44d8f:

netfilter: nf_tables: fix ct untracked match breakage (2023-05-03 13:49:08 +0200)

----------------------------------------------------------------
netfilter pull request 23-05-03

----------------------------------------------------------------
Florian Westphal (1):
netfilter: nf_tables: fix ct untracked match breakage

 net/netfilter/nft_ct_fast.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
author maintainer
#1 lore raw

PATCH 1/1 netfilter: nf_tables: fix ct untracked match breakage

From: Florian Westphal <[email protected]>

"ct untracked" no longer works properly due to erroneous NFT_BREAK. We have to check ctinfo enum first.

Fixes d9e789147605 ("netfilter: nf_tables: avoid retpoline overhead for some ct expression calls")
---
 net/netfilter/nft_ct_fast.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
net/netfilter/nft_ct_fast.c +10 -4
index 89983b0613fa..e684c8a91848 100644
@@ -15,10 +15,6 @@ void nft_ct_get_fast_eval(const struct nft_expr *expr,
 	unsigned int state;
 
 	ct = nf_ct_get(pkt->skb, &ctinfo);
-	if (!ct) {
-		regs->verdict.code = NFT_BREAK;
-		return;
-	}
 
 	switch (priv->key) {
 	case NFT_CT_STATE:
@@ -30,6 +26,16 @@ void nft_ct_get_fast_eval(const struct nft_expr *expr,
 			state = NF_CT_STATE_INVALID_BIT;
 		*dest = state;
 		return;
+	default:
+		break;
+	}
+
+	if (!ct) {
+		regs->verdict.code = NFT_BREAK;
+		return;
+	}
+
+	switch (priv->key) {
 	case NFT_CT_DIRECTION:
 		nft_reg_store8(dest, CTINFO2DIR(ctinfo));
 		return;
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH net 1/1] netfilter: nf_tables: fix ct untracked match breakage

This patch was applied to netdev/net.git (main) by Pablo Neira Ayuso <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Pablo Neira Ayuso <[email protected]>:

Quoted 5 lines · On Wed, 3 May 2023 22:11:43 +0200 you wrote:

From: Florian Westphal <[email protected]>

"ct untracked" no longer works properly due to erroneous NFT_BREAK. We have to check ctinfo enum first.

Quoted 7 lines
Fixes d9e789147605 ("netfilter: nf_tables: avoid retpoline overhead for some ct expression calls")

[...]

Here is the summary with links:
- [net,1/1] netfilter: nf_tables: fix ct untracked match breakage

    https://git.kernel.org/netdev/net/c/f057b63bc11d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html