Jozsef Kadlecsik 7433b6d2af netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP
Kyle Zeng reported that there is a race between IPSET_CMD_ADD and IPSET_CMD_SWAP
in netfilter/ip_set, which can lead to the invocation of `__ip_set_put` on a
wrong `set`, triggering the `BUG_ON(set->ref == 0);` check in it.

The race is caused by using the wrong reference counter, i.e. the ref counter instead
of ref_netlink.

Fixes: 24e227896bbf ("netfilter: ipset: Add schedule point in call_ad().")
Reported-by: Kyle Zeng <zengyhkyle@gmail.com>
Closes: https://lore.kernel.org/netfilter-devel/ZPZqetxOmH+w%2Fmyc@westworld/#r
Tested-by: Kyle Zeng <zengyhkyle@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
2023-09-20 10:35:24 +02:00
..
2023-09-19 13:35:15 +02:00
2023-08-29 17:39:15 -07:00
2023-08-16 11:09:16 +01:00
2023-08-25 18:35:09 -07:00
2023-06-24 15:41:46 -07:00
2023-08-28 06:58:46 +01:00
2023-09-01 09:38:00 -07:00
2023-06-28 16:43:10 -07:00
2023-08-31 15:36:41 -07:00
2023-08-29 17:39:15 -07:00