linux-stable/drivers/net
Eric Dumazet 70a36f5713 udp: annotate data-races around udp->encap_type
syzbot/KCSAN complained about UDP_ENCAP_L2TPINUDP setsockopt() racing.

Add READ_ONCE()/WRITE_ONCE() to document races on this lockless field.

syzbot report was:
BUG: KCSAN: data-race in udp_lib_setsockopt / udp_lib_setsockopt

read-write to 0xffff8881083603fa of 1 bytes by task 16557 on cpu 0:
udp_lib_setsockopt+0x682/0x6c0
udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779
sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697
__sys_setsockopt+0x1c9/0x230 net/socket.c:2263
__do_sys_setsockopt net/socket.c:2274 [inline]
__se_sys_setsockopt net/socket.c:2271 [inline]
__x64_sys_setsockopt+0x66/0x80 net/socket.c:2271
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

read-write to 0xffff8881083603fa of 1 bytes by task 16554 on cpu 1:
udp_lib_setsockopt+0x682/0x6c0
udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779
sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697
__sys_setsockopt+0x1c9/0x230 net/socket.c:2263
__do_sys_setsockopt net/socket.c:2274 [inline]
__se_sys_setsockopt net/socket.c:2271 [inline]
__x64_sys_setsockopt+0x66/0x80 net/socket.c:2271
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x01 -> 0x05

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 16554 Comm: syz-executor.5 Not tainted 6.5.0-rc7-syzkaller-00004-gf7757129e3de #0

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-09-14 16:16:36 +02:00
..
appletalk
arcnet net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-08-25 10:10:52 +01:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-24 10:51:39 -07:00
caif
can TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
dsa net: dsa: sja1105: block FDB accesses that are concurrent with a switch reset 2023-09-11 08:32:30 +01:00
ethernet net: ethernet: mtk_wed: check update_wo_rx_stats in mtk_wed_update_rx_stats() 2023-09-14 15:33:00 +02:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa ARM: SoC drivers for 6.6 2023-08-30 16:42:21 -07:00
ipvlan
mctp
mdio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-24 10:51:39 -07:00
netdevsim
pcs net: pcs: xpcs: adapt Wangxun NICs for SGMII mode 2023-08-25 07:42:59 +01:00
phy net: phy: Provide Module 4 KSZ9477 errata (DS80000754C) 2023-09-06 20:49:04 -07:00
plip
ppp TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
pse-pd
slip
team Revert "net: team: do not use dynamic lockdep key" 2023-09-07 11:19:36 -07:00
thunderbolt
usb r8152: check budget for r8152_poll() 2023-09-11 09:58:34 +01:00
vmxnet3
vxlan vxlan: vnifilter: Use GFP_KERNEL instead of GFP_ATOMIC 2023-08-22 10:58:45 -07:00
wan
wireguard
wireless USB / Thunderbolt / PHY driver update for 6.6-rc1 2023-09-01 09:23:34 -07:00
wwan wwan: core: Use the bitmap API to allocate bitmaps 2023-09-12 11:49:22 +02:00
xen-netback
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c udp: annotate data-races around udp->encap_type 2023-09-14 16:16:36 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c Revert "net: macsec: preserve ingress frame ordering" 2023-09-05 10:56:55 +02:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c
veth.c veth: Fixing transmit return status for dropped packets 2023-09-04 06:52:39 +01:00
virtio_net.c virtio: features 2023-09-04 10:43:44 -07:00
vrf.c sysctl-6.6-rc1 2023-08-29 17:39:15 -07:00
vsockmon.c
xen-netfront.c