Commit 6c1f7e2c authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik Committed by Jozsef Kadlecsik

netfilter: ipset: Fix rename concurrency with listing

Shijie Luo reported that when stress-testing ipset with multiple concurrent
create, rename, flush, list, destroy commands, it can result

ipset <version>: Broken LIST kernel message: missing DATA part!

error messages and broken list results. The problem was the rename operation
was not properly handled with respect of listing. The patch fixes the issue.
Reported-by: default avatarShijie Luo <luoshijie1@huawei.com>
Signed-off-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
parent 1b4a7510
......@@ -1161,7 +1161,7 @@ static int ip_set_rename(struct net *net, struct sock *ctnl,
return -ENOENT;
write_lock_bh(&ip_set_ref_lock);
if (set->ref != 0) {
if (set->ref != 0 || set->ref_netlink != 0) {
ret = -IPSET_ERR_REFERENCED;
goto out;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment