Commit 7433b6d
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: 24e2278 ("netfilter: ipset: Add schedule point in call_ad().")
Reported-by: Kyle Zeng <[email protected]>
Closes: https://lore.kernel.org/netfilter-devel/ZPZqetxOmH+w%2Fmyc@westworld/#r
Tested-by: Kyle Zeng <[email protected]>
Signed-off-by: Jozsef Kadlecsik <[email protected]>
Signed-off-by: Florian Westphal <[email protected]>1 parent cf5000a commit 7433b6d
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
685 | 693 | | |
686 | 694 | | |
687 | 695 | | |
| |||
1693 | 1701 | | |
1694 | 1702 | | |
1695 | 1703 | | |
1696 | | - | |
| 1704 | + | |
1697 | 1705 | | |
1698 | 1706 | | |
1699 | 1707 | | |
1700 | | - | |
| 1708 | + | |
1701 | 1709 | | |
1702 | 1710 | | |
1703 | 1711 | | |
| |||
0 commit comments