提交 0c1ae2db 编写于 作者: P Pablo Neira Ayuso 提交者: Zheng Zengkai

netfilter: nf_tables: really skip inactive sets when allocating name

stable inclusion
from stable-v5.10.138
commit 8d2fe4b9ed4e27340a58743de207f54d424c52f0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60QFD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8d2fe4b9ed4e27340a58743de207f54d424c52f0

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

commit 271c5ca8 upstream.

While looping to build the bitmap of used anonymous set names, check the
current set in the iteration, instead of the one that is being created.

Fixes: 37a9cc52 ("netfilter: nf_tables: add generation mask to sets")
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 d3382c6d
...@@ -3702,7 +3702,7 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set, ...@@ -3702,7 +3702,7 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
list_for_each_entry(i, &ctx->table->sets, list) { list_for_each_entry(i, &ctx->table->sets, list) {
int tmp; int tmp;
if (!nft_is_active_next(ctx->net, set)) if (!nft_is_active_next(ctx->net, i))
continue; continue;
if (!sscanf(i->name, name, &tmp)) if (!sscanf(i->name, name, &tmp))
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册