Skip to content

Commit 424bd79

Browse files
ummakynesgregkh
authored andcommitted
netfilter: nf_tables: missing iterator type in lookup walk
commit efefd4f upstream. Add missing decorator type to lookup expression and tighten WARN_ON_ONCE check in pipapo to spot earlier that this is unset. Fixes: 29b359c ("netfilter: nft_set_pipapo: walk over current view on netlink dump") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f24d8ab commit 424bd79

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

net/netfilter/nft_lookup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ static int nft_lookup_validate(const struct nft_ctx *ctx,
217217
return 0;
218218

219219
iter.genmask = nft_genmask_next(ctx->net);
220+
iter.type = NFT_ITER_UPDATE;
220221
iter.skip = 0;
221222
iter.count = 0;
222223
iter.err = 0;

net/netfilter/nft_set_pipapo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,8 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
20412041
const struct nft_pipapo_field *f;
20422042
int i, r;
20432043

2044-
WARN_ON_ONCE(iter->type == NFT_ITER_UNSPEC);
2044+
WARN_ON_ONCE(iter->type != NFT_ITER_READ &&
2045+
iter->type != NFT_ITER_UPDATE);
20452046

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

0 commit comments

Comments
 (0)