Commit 41f02a7a authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Wang Hai
Browse files

netfilter: nf_tables: missing iterator type in lookup walk

mainline inclusion
from mainline-v6.9-rc5
commit efefd4f00c967d00ad7abe092554ffbb70c1a793
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9L5O8
CVE: CVE-2024-27017

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efefd4f00c967d00ad7abe092554ffbb70c1a793



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

Add missing decorator type to lookup expression and tighten WARN_ON_ONCE
check in pipapo to spot earlier that this is unset.

Fixes: 29b359cf6d95 ("netfilter: nft_set_pipapo: walk over current view on netlink dump")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>

Conflicts:
	net/netfilter/nft_set_pipapo.c
[ Context conflicts. ]
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
parent 10ac25dc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ static int nft_lookup_validate(const struct nft_ctx *ctx,
		return 0;

	iter.genmask	= nft_genmask_next(ctx->net);
	iter.type	= NFT_ITER_UPDATE;
	iter.skip	= 0;
	iter.count	= 0;
	iter.err	= 0;
+2 −1
Original line number Diff line number Diff line
@@ -2022,7 +2022,8 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
	struct nft_pipapo_field *f;
	int i, r;

	WARN_ON_ONCE(iter->type == NFT_ITER_UNSPEC);
	WARN_ON_ONCE(iter->type != NFT_ITER_READ &&
		     iter->type != NFT_ITER_UPDATE);

	rcu_read_lock();
	if (iter->type == NFT_ITER_READ)