linux-yocto/net
Jiayuan Chen fbade4bd08 mptcp: Disallow MPTCP subflows from sockmap
The sockmap feature allows bpf syscall from userspace, or based on bpf
sockops, replacing the sk_prot of sockets during protocol stack processing
with sockmap's custom read/write interfaces.
'''
tcp_rcv_state_process()
  subflow_syn_recv_sock()
    tcp_init_transfer(BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB)
      bpf_skops_established       <== sockops
        bpf_sock_map_update(sk)   <== call bpf helper
          tcp_bpf_update_proto()  <== update sk_prot
'''
Consider two scenarios:

1. When the server has MPTCP enabled and the client also requests MPTCP,
   the sk passed to the BPF program is a subflow sk. Since subflows only
   handle partial data, replacing their sk_prot is meaningless and will
   cause traffic disruption.

2. When the server has MPTCP enabled but the client sends a TCP SYN
   without MPTCP, subflow_syn_recv_sock() performs a fallback on the
   subflow, replacing the subflow sk's sk_prot with the native sk_prot.
   '''
   subflow_ulp_fallback()
    subflow_drop_ctx()
      mptcp_subflow_ops_undo_override()
   '''
   Subsequently, accept::mptcp_stream_accept::mptcp_fallback_tcp_ops()
   converts the subflow to plain TCP.

For the first case, we should prevent it from being combined with sockmap
by setting sk_prot->psock_update_sk_prot to NULL, which will be blocked by
sockmap's own flow.

For the second case, since subflow_syn_recv_sock() has already restored
sk_prot to native tcp_prot/tcpv6_prot, no further action is needed.

Fixes: cec37a6e41 ("mptcp: Handle MP_CAPABLE options for outgoing connections")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20251111060307.194196-2-jiayuan.chen@linux.dev
2025-11-13 09:15:41 -08:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv Here is a batman-adv bugfix: 2025-10-27 18:00:54 -07:00
bluetooth Bluetooth: rfcomm: fix modem control handling 2025-10-24 10:32:19 -04:00
bpf bpf: Do not disable preemption in bpf_test_run(). 2025-10-17 11:29:35 -07:00
bridge bridge: br_vlan_fill_forward_path_pvid: use br_vlan_group_rcu() 2025-10-08 13:17:31 +02:00
caif
can can: j1939: add missing calls in NETDEV_UNREGISTER notification handler 2025-10-13 21:26:31 +02:00
ceph Some messenger improvements from Eric and Max, a patch to address the 2025-10-10 11:30:19 -07:00
core bpf-fixes 2025-10-31 18:22:26 -07:00
dcb Revert "Documentation: net: add flow control guide and document ethtool API" 2025-10-01 09:48:21 +02:00
devlink net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
dns_resolver
dsa
ethernet
ethtool Revert "Documentation: net: add flow control guide and document ethtool API" 2025-10-01 09:48:21 +02:00
handshake
hsr net: hsr: prevent creation of HSR device with slaves from another netns 2025-10-22 19:22:22 -07:00
ieee802154
ife
ipv4 tcp: fix too slow tcp_rcvbuf_grow() action 2025-10-29 17:30:19 -07:00
ipv6 net/ip6_tunnel: Prevent perpetual tunnel growth 2025-10-13 17:43:46 -07:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211 wifi: mac80211: fix key tailroom accounting leak 2025-10-20 13:57:10 +02:00
mac802154
mctp
mpls
mptcp mptcp: Disallow MPTCP subflows from sockmap 2025-11-13 09:15:41 -08:00
ncsi
netfilter netfilter: nft_ct: add seqadj extension for natted connections 2025-10-29 14:47:59 +01:00
netlabel
netlink
netrom
nfc net: nfc: nci: Add parameter validation for packet data 2025-09-30 10:27:14 +02:00
nsh
openvswitch net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
packet
phonet
psample
psp net: psp: don't assume reply skbs will have a socket 2025-10-03 10:23:50 -07:00
qrtr
rds net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
rfkill net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
rose
rxrpc net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
sched
sctp net: sctp: fix KMSAN uninit-value in sctp_inq_pop 2025-10-30 11:21:05 +01:00
shaper
smc net/smc: fix general protection fault in __smc_diag_dump 2025-10-20 17:46:06 -07:00
strparser
sunrpc NFSD 6.18 Release Notes 2025-10-06 13:22:21 -07:00
switchdev
tipc net: doc: Fix typos in docs 2025-10-03 10:24:14 -07:00
tls net: tls: Cancel RX async resync request on rcd_delta overflow 2025-10-29 18:32:18 -07:00
unix Networking changes for 6.18. 2025-10-02 15:17:01 -07:00
vmw_vsock vsock: fix lock inversion in vsock_assign_transport() 2025-10-23 16:07:58 +02:00
wireless wifi: nl80211: call kfree without a NULL check 2025-10-20 13:57:26 +02:00
x25
xdp xsk: Harden userspace-supplied xdp_desc validation 2025-10-10 10:07:48 -07:00
xfrm espintcp: use datagram_poll_queue for socket readiness 2025-10-23 15:46:04 +02:00
compat.c
devres.c
Kconfig dibs: Create drivers/dibs 2025-09-23 11:13:21 +02:00
Kconfig.debug
Makefile
socket.c Networking changes for 6.18. 2025-10-02 15:17:01 -07:00
sysctl_net.c