linux-stable/net
Breno Leitao a130e7da73 netpoll: Fix race condition in netpoll_owner_active
[ Upstream commit c2e6a872bd ]

KCSAN detected a race condition in netpoll:

	BUG: KCSAN: data-race in net_rx_action / netpoll_send_skb
	write (marked) to 0xffff8881164168b0 of 4 bytes by interrupt on cpu 10:
	net_rx_action (./include/linux/netpoll.h:90 net/core/dev.c:6712 net/core/dev.c:6822)
<snip>
	read to 0xffff8881164168b0 of 4 bytes by task 1 on cpu 2:
	netpoll_send_skb (net/core/netpoll.c:319 net/core/netpoll.c:345 net/core/netpoll.c:393)
	netpoll_send_udp (net/core/netpoll.c:?)
<snip>
	value changed: 0x0000000a -> 0xffffffff

This happens because netpoll_owner_active() needs to check if the
current CPU is the owner of the lock, touching napi->poll_owner
non atomically. The ->poll_owner field contains the current CPU holding
the lock.

Use an atomic read to check if the poll owner is the current CPU.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20240429100437.3487432-1-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-27 13:52:14 +02:00
..
6lowpan
9p net/9p: fix uninit-value in p9_client_rpc() 2024-06-16 13:51:05 +02:00
802
8021q net: gro: fix udp bad offset in socket lookup by adding {inner_}network_offset to napi_gro_cb 2024-05-02 11:02:48 +02:00
appletalk appletalk: Improve handling of broadcast packets 2024-05-08 12:17:19 +01:00
atm inet: introduce dst_rtable() helper 2024-06-12 11:39:55 +02:00
ax25 ax25: Replace kfree() in ax25_dev_free() with ax25_dev_put() 2024-06-21 14:40:03 +02:00
batman-adv batman-adv: bypass empty buckets in batadv_purge_orig_ref() 2024-06-27 13:52:13 +02:00
bluetooth Bluetooth: fix connection setup in l2cap_connect 2024-06-21 14:40:22 +02:00
bpf bpf: Set run context for rawtp test_run callback 2024-06-21 14:40:05 +02:00
bridge net: bridge: mst: fix suspicious rcu usage in br_mst_set_state 2024-06-21 14:40:25 +02:00
caif
can
ceph libceph: init the cursor when preparing sparse read in msgr2 2024-03-06 12:43:01 +01:00
core netpoll: Fix race condition in netpoll_owner_active 2024-06-27 13:52:14 +02:00
dcb
dccp Kbuild updates for v6.9 2024-03-21 14:41:00 -07:00
devlink devlink: use kvzalloc() to allocate devlink instance resources 2024-06-27 13:52:12 +02:00
dns_resolver
dsa net: dsa: Leverage core stats allocator 2024-03-07 20:37:13 -08:00
ethernet netkit: Fix pkt_type override upon netkit pass verdict 2024-06-12 11:39:48 +02:00
ethtool net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool() 2024-06-21 14:40:10 +02:00
handshake
hsr hsr: Simplify code for announcing HSR nodes timer setup 2024-05-08 18:56:30 -07:00
ieee802154 Merge tag 'ieee802154-for-net-next-2024-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next 2024-03-08 20:35:33 -08:00
ife
ipv4 tcp: use signed arithmetic in tcp_rtx_probe0_timed_out() 2024-06-21 14:40:23 +02:00
ipv6 net/ipv6: Fix the RT cache flush via sysctl using a previous delay 2024-06-21 14:40:25 +02:00
iucv more s390 updates for 6.9 merge window 2024-03-19 11:38:27 -07:00
kcm net: kcm: fix incorrect parameter validation in the kcm_getsockopt) function 2024-03-11 09:53:22 +00:00
key
l2tp inet: introduce dst_rtable() helper 2024-06-12 11:39:55 +02:00
l3mdev
lapb
llc
mac80211 wifi: mac80211: correctly parse Spatial Reuse Parameter Set element 2024-06-21 14:40:02 +02:00
mac802154 mac802154: fix llsec key resources release in mac802154_llsec_key_del 2024-03-06 21:01:26 +01:00
mctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-29 14:24:56 -08:00
mpls inet: introduce dst_rtable() helper 2024-06-12 11:39:55 +02:00
mptcp mptcp: pm: update add_addr counters after connect 2024-06-21 14:40:30 +02:00
ncsi net/ncsi: Fix the multi thread manner of NCSI driver 2024-06-21 14:40:03 +02:00
netfilter netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type 2024-06-21 14:40:23 +02:00
netlabel netlabel: remove impossible return value in netlbl_bitmap_walk 2024-02-28 19:37:34 -08:00
netlink net/netlink: Add getsockopt support for NETLINK_LISTEN_ALL_NSID 2024-03-11 15:48:34 -07:00
netrom netrom: fix possible dead-lock in nr_rt_ioctl() 2024-05-30 09:45:02 +02:00
nfc nfc: nci: Fix handling of zero-length payload packets in nci_rx_work() 2024-06-12 11:39:43 +02:00
nsh nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment(). 2024-04-26 12:20:01 +02:00
openvswitch openvswitch: Set the skbuff pkt_type for proper pmtud support. 2024-06-12 11:39:41 +02:00
packet af_packet: avoid a false positive warning in packet_setsockopt() 2024-06-27 13:52:13 +02:00
phonet phonet: fix rtm_phonet_notify() skb allocation 2024-05-06 18:30:00 -07:00
psample
qrtr net: qrtr: ns: Fix module refcnt 2024-05-30 09:45:02 +02:00
rds net/rds: fix possible cp null dereference 2024-03-29 12:04:09 -07:00
rfkill
rose
rxrpc rxrpc: Only transmit one ACK per jumbo packet received 2024-05-08 08:05:03 -07:00
sched net/sched: fix false lockdep warning on qdisc root lock 2024-06-27 13:52:14 +02:00
sctp inet: introduce dst_rtable() helper 2024-06-12 11:39:55 +02:00
smc net/smc: avoid overwriting when adjusting sock bufsizes 2024-06-21 14:40:05 +02:00
strparser
sunrpc SUNRPC: return proper error from gss_wrap_req_priv 2024-06-21 14:40:17 +02:00
switchdev
tipc inet: introduce dst_rtable() helper 2024-06-12 11:39:55 +02:00
tls tls: fix missing memory barrier in tls_init 2024-06-12 11:39:43 +02:00
unix af_unix: Read with MSG_PEEK loops if the first unread byte is OOB 2024-06-21 14:40:26 +02:00
vmw_vsock vsock/virtio: fix packet delivery to tap device 2024-04-02 18:00:24 -07:00
wireless wifi: cfg80211: validate HE operation element parsing 2024-06-21 14:40:31 +02:00
x25 net/x25: fix incorrect parameter validation in the x25_getsockopt() function 2024-03-11 09:53:22 +00:00
xdp Revert "xsk: Support redirect to any socket bound to the same umem" 2024-06-16 13:51:10 +02:00
xfrm net: fix __dst_negative_advice() race 2024-06-12 11:39:55 +02:00
compat.c
devres.c
Kconfig
Kconfig.debug
Makefile
socket.c net: remove {revc,send}msg_copy_msghdr() from exports 2024-03-14 16:48:53 -07:00
sysctl_net.c