Commit b301e6d
committed
netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP
jira VULN-34700
cve CVE-2023-42756
commit-author Jozsef Kadlecsik <[email protected]>
commit 7433b6d
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]>
(cherry picked from commit 7433b6d)
Signed-off-by: Marcin Wcisło <[email protected]>1 parent d9e0b48 commit b301e6d
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
687 | 695 | | |
688 | 696 | | |
689 | 697 | | |
| |||
1699 | 1707 | | |
1700 | 1708 | | |
1701 | 1709 | | |
1702 | | - | |
| 1710 | + | |
1703 | 1711 | | |
1704 | 1712 | | |
1705 | 1713 | | |
1706 | | - | |
| 1714 | + | |
1707 | 1715 | | |
1708 | 1716 | | |
1709 | 1717 | | |
| |||
0 commit comments