Skip to content

Commit 077ef85

Browse files
Florian Westphalgregkh
authored andcommitted
netfilter: nf_tables: add rescheduling points during loop detection walks
[ 81ea010 ] Add explicit rescheduling points during ruleset walk. Switching to a faster algorithm is possible but this is a much smaller change, suitable for nf tree. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1460 Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1135285 commit 077ef85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,8 @@ int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain)
27122712
if (err < 0)
27132713
return err;
27142714
}
2715+
2716+
cond_resched();
27152717
}
27162718

27172719
return 0;
@@ -7379,9 +7381,13 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
73797381
break;
73807382
}
73817383
}
7384+
7385+
cond_resched();
73827386
}
73837387

73847388
list_for_each_entry(set, &ctx->table->sets, list) {
7389+
cond_resched();
7390+
73857391
if (!nft_is_active_next(ctx->net, set))
73867392
continue;
73877393
if (!(set->flags & NFT_SET_MAP) ||

0 commit comments

Comments
 (0)