linux/net
Vishwanath Pai 5689eba90a netfilter: ipset: regression in ip_set_hash_ip.c
[ Upstream commit c7aa1a76d4 ]

This patch introduced a regression: commit 48596a8ddc ("netfilter:
ipset: Fix adding an IPv4 range containing more than 2^31 addresses")

The variable e.ip is passed to adtfn() function which finally adds the
ip address to the set. The patch above refactored the for loop and moved
e.ip = htonl(ip) to the end of the for loop.

What this means is that if the value of "ip" changes between the first
assignement of e.ip and the forloop, then e.ip is pointing to a
different ip address than "ip".

Test case:
$ ipset create jdtest_tmp hash:ip family inet hashsize 2048 maxelem 100000
$ ipset add jdtest_tmp 10.0.1.1/31
ipset v6.21.1: Element cannot be added to the set: it's already added

The value of ip gets updated inside the  "else if (tb[IPSET_ATTR_CIDR])"
block but e.ip is still pointing to the old value.

Fixes: 48596a8ddc ("netfilter: ipset: Fix adding an IPv4 range containing more than 2^31 addresses")
Reviewed-by: Joshua Hunt <johunt@akamai.com>
Signed-off-by: Vishwanath Pai <vpai@akamai.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-02 17:40:01 +01:00
..
6lowpan
9p 9p/fd: fix issue of list_del corruption in p9_fd_cancel() 2022-12-02 17:40:00 +01:00
802
8021q net: make free_netdev() more lenient with unregistering devices 2022-07-29 17:19:07 +02:00
appletalk
atm net/atm: fix proc_mpc_write incorrect return value 2022-10-30 09:41:16 +01:00
ax25 net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg 2022-06-22 14:13:17 +02:00
batman-adv
bluetooth Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm 2022-11-25 17:45:40 +01:00
bpf bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() 2022-11-25 17:45:43 +01:00
bpfilter
bridge bridge: switchdev: Fix memory leaks when changing VLAN protocol 2022-12-02 17:39:57 +01:00
caif net: caif: fix double disconnect client in chnl_net_open() 2022-11-25 17:45:46 +01:00
can can: j1939: j1939_send_one(): fix missing CAN header initialization 2022-11-16 09:57:17 +01:00
ceph
core netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:40:00 +01:00
dcb
dccp dccp: put dccp_qpolicy_full() and dccp_qpolicy_push() in the same lock 2022-08-21 15:15:52 +02:00
decnet net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-08-31 17:15:19 +02:00
dns_resolver
dsa
ethernet
ethtool
hsr net: hsr: avoid possible NULL deref in skb_clone() 2022-10-30 09:41:17 +01:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:57:51 +09:00
ife
ipv4 netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:40:00 +01:00
ipv6 xfrm: replay: Fix ESN wrap around for GSO 2022-12-02 17:39:58 +01:00
iucv
kcm kcm: close race conditions on sk_receive_queue 2022-11-25 17:45:56 +01:00
key af_key: Fix send_acquire race with pfkey_register 2022-12-02 17:39:58 +01:00
l2tp net: fix a concurrency bug in l2tp_tunnel_register() 2022-11-25 17:45:54 +01:00
l3mdev
lapb
llc
mac80211 wifi: mac80211: Fix ack frame idr leak when mesh has no route 2022-12-02 17:39:57 +01:00
mac802154 mac802154: Fix LQI recording 2022-11-03 23:57:49 +09:00
mpls net: Use u64_stats_fetch_begin_irq() for stats fetch. 2022-09-08 11:11:40 +02:00
mptcp net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-08-31 17:15:19 +02:00
ncsi
netfilter netfilter: ipset: regression in ip_set_hash_ip.c 2022-12-02 17:40:01 +01:00
netlabel
netlink net: genl: fix error path memory leak in policy dumping 2022-08-25 11:38:07 +02:00
netrom
nfc nfc/nci: fix race with opening and closing 2022-12-02 17:39:59 +01:00
nsh
openvswitch netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:40:00 +01:00
packet net/af_packet: check len when min_header_len equals to 0 2022-09-05 10:28:59 +02:00
phonet
psample
qrtr qrtr: Convert qrtr_ports from IDR to XArray 2022-08-25 11:38:23 +02:00
rds net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks() 2022-10-26 13:25:23 +02:00
rfkill
rose rose: Fix NULL pointer dereference in rose_send_frame() 2022-11-10 18:14:19 +01:00
rxrpc rxrpc: Fix race between conn bundle lookup and bundle removal [ZDI-CAN-15975] 2022-12-02 17:39:59 +01:00
sched netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:40:00 +01:00
sctp sctp: clear out_curr if all frag chunks of current msg are pruned 2022-11-25 17:45:43 +01:00
smc net/smc: Stop the CLC flow if no link to map buffers on 2022-09-28 11:10:36 +02:00
strparser
sunrpc SUNRPC: RPC level errors should set task->tk_rpc_status 2022-08-31 17:15:15 +02:00
switchdev
tipc tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header 2022-11-16 09:57:11 +01:00
tls net/tls: Remove the context from the list in tls_device_down 2022-08-03 12:00:46 +02:00
unix io_uring/af_unix: defer registered files gc to io_uring release 2022-10-26 13:25:55 +02:00
vmw_vsock vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-26 13:25:22 +02:00
wimax
wireless wifi: cfg80211: fix memory leak in query_regdb_file() 2022-11-16 09:57:08 +01:00
x25 net/x25: Fix skb leak in x25_lapb_receive_frame() 2022-11-25 17:45:47 +01:00
xdp xsk: Inherit need_wakeup flag for shared sockets 2022-10-15 07:55:51 +02:00
xfrm xfrm: replay: Fix ESN wrap around for GSO 2022-12-02 17:39:58 +01:00
compat.c
devres.c
Kconfig
Makefile
socket.c net: Fix a data-race around sysctl_somaxconn. 2022-08-31 17:15:21 +02:00
sysctl_net.c