linux/net
Jozsef Kadlecsik ea5a61d588 netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP
[ Upstream commit 7433b6d2af ]

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: 24e227896b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-06 14:56:41 +02:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Fix hci_suspend_sync crash 2023-09-23 11:11:02 +02:00
bpf
bpfilter
bridge net: bridge: use DEV_STATS_INC() 2023-10-06 14:56:41 +02:00
caif
can
ceph
core net/core: Fix ETH_P_1588 flow dissector 2023-10-06 14:56:36 +02:00
dcb
dccp dccp: fix dccp_v4_err()/dccp_v6_err() again 2023-10-06 14:56:39 +02:00
devlink devlink: remove reload failed checks in params get/set callbacks 2023-09-23 11:11:01 +02:00
dns_resolver
dsa
ethernet
ethtool ipv6: Remove in6addr_any alternatives. 2023-09-19 12:28:10 +02:00
hsr net: hsr: Properly parse HSRv1 supervisor frames. 2023-10-06 14:56:39 +02:00
ieee802154
ife
ipv4 ipv4: fix null-deref in ipv4_link_failure 2023-10-06 14:56:38 +02:00
ipv6
iucv
kcm kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). 2023-09-19 12:28:10 +02:00
key
l2tp
l3mdev
lapb
llc
mac80211 wifi: mac80211: check for station first in client probe 2023-09-23 11:11:03 +02:00
mac802154
mctp
mpls
mptcp
ncsi
netfilter netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP 2023-10-06 14:56:41 +02:00
netlabel
netlink netlink: convert nlk->flags to atomic flags 2023-09-23 11:11:02 +02:00
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds net: rds: Fix possible NULL-pointer dereference 2023-10-06 14:56:41 +02:00
rfkill
rose
rxrpc
sched net/sched: Retire rsvp classifier 2023-09-23 11:11:13 +02:00
sctp
smc net/smc: use smc_lgr_list.lock to protect smc_lgr_list.list iterate in smcr_port_add 2023-09-19 12:28:08 +02:00
strparser
sunrpc NFSv4.1: fix pnfs MDS=DS session trunking 2023-10-06 14:56:31 +02:00
switchdev
tipc
tls net/tls: do not free tls_rec on async operation in bpf_exec_tx_verdict() 2023-09-19 12:28:09 +02:00
unix af_unix: Fix data-race around unix_tot_inflight. 2023-09-19 12:28:02 +02:00
vmw_vsock
wireless wifi: cfg80211: ocb: don't leave if not joined 2023-09-23 11:11:03 +02:00
x25
xdp
xfrm
compat.c
devres.c
Kconfig
Kconfig.debug
Makefile
socket.c
sysctl_net.c