diff mbox series

[net,1/5] netfilter: nf_tables: disallow anonymous set with timeout flag

Message ID 20240307021545.149386-2-pablo@netfilter.org (mailing list archive)
State Accepted
Commit 16603605b667b70da974bea8216c93e7db043bf1
Delegated to: Netdev Maintainers
Headers show
Series [net,1/5] netfilter: nf_tables: disallow anonymous set with timeout flag | expand

Checks

Context Check Description
netdev/series_format success Pull request is its own cover letter
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 972 this patch: 972
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: kadlec@netfilter.org coreteam@netfilter.org
netdev/build_clang success Errors and warnings before: 972 this patch: 972
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 988 this patch: 988
netdev/checkpatch warning WARNING: line length of 85 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-07--09-00 (tests: 891)

Commit Message

Pablo Neira Ayuso March 7, 2024, 2:15 a.m. UTC
Anonymous sets are never used with timeout from userspace, reject this.
Exception to this rule is NFT_SET_EVAL to ensure legacy meters still work.

Cc: stable@vger.kernel.org
Fixes: 761da2935d6e ("netfilter: nf_tables: add set timeout API support")
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org March 7, 2024, 10:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by Pablo Neira Ayuso <pablo@netfilter.org>:

On Thu,  7 Mar 2024 03:15:41 +0100 you wrote:
> Anonymous sets are never used with timeout from userspace, reject this.
> Exception to this rule is NFT_SET_EVAL to ensure legacy meters still work.
> 
> Cc: stable@vger.kernel.org
> Fixes: 761da2935d6e ("netfilter: nf_tables: add set timeout API support")
> Reported-by: lonial con <kongln9170@gmail.com>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> 
> [...]

Here is the summary with links:
  - [net,1/5] netfilter: nf_tables: disallow anonymous set with timeout flag
    https://git.kernel.org/netdev/net/c/16603605b667
  - [net,2/5] netfilter: nf_tables: reject constant set with timeout
    https://git.kernel.org/netdev/net/c/5f4fc4bd5cdd
  - [net,3/5] netfilter: nft_ct: fix l3num expectations with inet pseudo family
    https://git.kernel.org/netdev/net/c/99993789966a
  - [net,4/5] netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout
    https://git.kernel.org/netdev/net/c/552705a3650b
  - [net,5/5] netfilter: nf_conntrack_h323: Add protection for bmp length out of range
    https://git.kernel.org/netdev/net/c/767146637efc

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 7e938c7397dd..bd21067f25cf 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5001,6 +5001,9 @@  static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
 		if ((flags & (NFT_SET_EVAL | NFT_SET_OBJECT)) ==
 			     (NFT_SET_EVAL | NFT_SET_OBJECT))
 			return -EOPNOTSUPP;
+		if ((flags & (NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT | NFT_SET_EVAL)) ==
+			     (NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT))
+			return -EOPNOTSUPP;
 	}
 
 	desc.dtype = 0;