Skip to content

Commit efefd4f

Browse files
committed
netfilter: nf_tables: missing iterator type in lookup walk
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]>
1 parent 75ce950 commit efefd4f

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
@@ -216,6 +216,7 @@ static int nft_lookup_validate(const struct nft_ctx *ctx,
216216
return 0;
217217

218218
iter.genmask = nft_genmask_next(ctx->net);
219+
iter.type = NFT_ITER_UPDATE;
219220
iter.skip = 0;
220221
iter.count = 0;
221222
iter.err = 0;

net/netfilter/nft_set_pipapo.c

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

2126-
WARN_ON_ONCE(iter->type == NFT_ITER_UNSPEC);
2126+
WARN_ON_ONCE(iter->type != NFT_ITER_READ &&
2127+
iter->type != NFT_ITER_UPDATE);
21272128

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

0 commit comments

Comments
 (0)