diff mbox series

[SRU,Jammy,OEM-6.0,OEM-6.1,Lunar] netfilter: nft_dynset: disallow object maps

Message ID 20230916004839.706452-30-cengiz.can@canonical.com
State New
Headers show
Series [SRU,Jammy,OEM-6.0,OEM-6.1,Lunar] netfilter: nft_dynset: disallow object maps | expand

Commit Message

Cengiz Can Sept. 16, 2023, 12:48 a.m. UTC
From: Pablo Neira Ayuso <pablo@netfilter.org>

Do not allow to insert elements from datapath to objects maps.

Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
(cherry picked from commit 23185c6aed1ffb8fc44087880ba2767aba493779)
CVE-2023-4244
Signed-off-by: Cengiz Can <cengiz.can@canonical.com>
---
 net/netfilter/nft_dynset.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index e65a83328b55..cf9a1ae87d9b 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -191,6 +191,9 @@  static int nft_dynset_init(const struct nft_ctx *ctx,
 	if (IS_ERR(set))
 		return PTR_ERR(set);
 
+	if (set->flags & NFT_SET_OBJECT)
+		return -EOPNOTSUPP;
+
 	if (set->ops->update == NULL)
 		return -EOPNOTSUPP;