linux-stable/net
Jordan Rife 9ccd5bc888 net: Avoid address overwrite in kernel_connect
commit 0bdf399342 upstream.

BPF programs that run on connect can rewrite the connect address. For
the connect system call this isn't a problem, because a copy of the address
is made when it is moved into kernel space. However, kernel_connect
simply passes through the address it is given, so the caller may observe
its address value unexpectedly change.

A practical example where this is problematic is where NFS is combined
with a system such as Cilium which implements BPF-based load balancing.
A common pattern in software-defined storage systems is to have an NFS
mount that connects to a persistent virtual IP which in turn maps to an
ephemeral server IP. This is usually done to achieve high availability:
if your server goes down you can quickly spin up a replacement and remap
the virtual IP to that endpoint. With BPF-based load balancing, mounts
will forget the virtual IP address when the address rewrite occurs
because a pointer to the only copy of that address is passed down the
stack. Server failover then breaks, because clients have forgotten the
virtual IP address. Reconnects fail and mounts remain broken. This patch
was tested by setting up a scenario like this and ensuring that NFS
reconnects worked after applying the patch.

Signed-off-by: Jordan Rife <jrife@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:47:56 +02:00
..
6lowpan 6lowpan: Remove redundant initialisation. 2023-03-29 08:22:52 +01:00
9p 9p: virtio: make sure 'offs' is initialized in zc_request 2023-09-13 09:47:50 +02:00
802
8021q vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit() 2023-05-17 12:55:39 +01:00
appletalk
atm atm: hide unused procfs functions 2023-05-17 21:27:30 -07:00
ax25
batman-adv batman-adv: Hold rtnl lock during MTU update via netlink 2023-08-30 14:52:40 +02:00
bluetooth Bluetooth: MGMT: Use correct address for memcpy() 2023-08-23 17:32:34 +02:00
bpf bpf: add test_run support for netfilter program type 2023-04-21 11:34:50 -07:00
bpfilter
bridge Revert "bridge: Add extack warning when enabling STP in netns." 2023-09-13 09:47:49 +02:00
caif
can can: raw: add missing refcount for memory leak fix 2023-08-30 14:52:42 +02:00
ceph libceph: fix potential hang in ceph_osdc_notify() 2023-08-11 12:14:19 +02:00
core net: annotate data-races around sk->sk_{rcv|snd}timeo 2023-09-13 09:47:53 +02:00
dcb net: dcb: choose correct policy to parse DCB_ATTR_BCN 2023-08-11 12:14:16 +02:00
dccp ipv4: fix data-races around inet->inet_id 2023-08-30 14:52:31 +02:00
devlink devlink: add missing unregister linecard notification 2023-08-30 14:52:29 +02:00
dns_resolver
dsa net: dsa: sja1105: always enable the send_meta options 2023-07-19 16:36:48 +02:00
ethernet
ethtool ethtool: Fix uninitialized number of lanes 2023-05-03 09:13:20 +01:00
handshake net/handshake: remove fput() that causes use-after-free 2023-06-14 22:26:37 -07:00
hsr hsr: ratelimit only when errors are printed 2023-03-16 21:11:03 -07:00
ieee802154 ieee802154: Replace strlcpy with strscpy 2023-06-16 22:14:24 +02:00
ife
ipv4 ipv4: fix data-races around inet->inet_id 2023-08-30 14:52:31 +02:00
ipv6 ip6_vti: fix slab-use-after-free in decode_session6 2023-08-23 17:32:42 +02:00
iucv net/iucv: Fix size of interrupt data 2023-03-16 17:34:40 -07:00
kcm
key net: af_key: fix sadb_x_filter validation 2023-08-23 17:32:42 +02:00
l2tp net: annotate data-races around sk->sk_mark 2023-08-11 12:14:13 +02:00
l3mdev
lapb
llc llc: Don't drop packet from non-root netns. 2023-07-27 08:57:01 +02:00
mac80211 wifi: mac80211: limit reorder_buf_filtered to avoid UBSAN warning 2023-08-30 14:52:34 +02:00
mac802154 Merge tag 'ieee802154-for-net-2023-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan 2023-06-20 09:32:33 +01:00
mctp
mpls net: move gso declarations and functions to their own files 2023-08-11 12:14:12 +02:00
mptcp mptcp: fix the incorrect judgment for msk->cb_flags 2023-08-16 18:32:25 +02:00
ncsi net/ncsi: change from ndo_set_mac_address to dev_set_mac_address 2023-07-23 13:54:17 +02:00
netfilter netfilter: nf_tables: fix kdoc warnings after gc rework 2023-08-30 14:52:45 +02:00
netlabel netlabel: fix shift wrapping bug in netlbl_catmap_setlong() 2023-06-10 19:54:06 +01:00
netlink netlink: Add __sock_i_ino() for __netlink_diag_dump(). 2023-07-19 16:35:38 +02:00
netrom netrom: fix info-leak in nr_write_internal() 2023-05-25 21:02:29 -07:00
nfc net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-19 16:35:36 +02:00
nsh net: move gso declarations and functions to their own files 2023-08-11 12:14:12 +02:00
openvswitch net: openvswitch: reject negative ifindex 2023-08-23 17:32:47 +02:00
packet net/packet: annotate data-races around tp->status 2023-08-16 18:32:25 +02:00
phonet
psample
qrtr net: qrtr: Fix an uninit variable access bug in qrtr_tx_resume() 2023-04-13 09:35:30 +02:00
rds
rfkill net: rfkill-gpio: Add explicit include for of.h 2023-04-06 20:36:27 +02:00
rose
rxrpc rxrpc: Truncate UTS_RELEASE for rxrpc version 2023-05-30 10:01:06 +02:00
sched net: annotate data-races around sk->sk_{rcv|snd}timeo 2023-09-13 09:47:53 +02:00
sctp ipv4: fix data-races around inet->inet_id 2023-08-30 14:52:31 +02:00
smc net/smc: Use correct buffer sizes when switching between TCP and SMC 2023-08-16 18:32:25 +02:00
strparser
sunrpc xprtrdma: Remap Receive buffers after a reconnect 2023-08-30 14:52:27 +02:00
switchdev
tipc tipc: stop tipc crypto on failure in tipc_node_create 2023-08-03 10:25:54 +02:00
tls net: tls: avoid discarding data on record close 2023-08-16 18:32:27 +02:00
unix af_unix: Fix null-ptr-deref in unix_stream_sendpage(). 2023-08-23 17:32:56 +02:00
vmw_vsock bpf, sockmap: Pass skb ownership through read_skb 2023-05-23 16:09:47 +02:00
wireless wifi: nl80211: fix integer overflow in nl80211_parse_mbssid_elems() 2023-08-16 18:32:16 +02:00
x25
xdp xsk: fix refcount underflow in error path 2023-08-16 18:32:26 +02:00
xfrm xfrm: don't skip free of empty state in acquire policy 2023-08-23 17:32:43 +02:00
Kconfig net/handshake: Add Kunit tests for the handshake consumer API 2023-04-19 18:48:48 -07:00
Kconfig.debug
Makefile net/handshake: Create a NETLINK service for handling handshake requests 2023-04-19 18:48:48 -07:00
compat.c net/compat: Update msg_control_is_user when setting a kernel pointer 2023-04-14 11:09:27 +01:00
devres.c
socket.c net: Avoid address overwrite in kernel_connect 2023-09-13 09:47:56 +02:00
sysctl_net.c