From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Jiayuan Chen <jiayuan.chen@linux.dev>,
Martin KaFai Lau <martin.lau@kernel.org>,
"Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH 6.6 07/86] mptcp: Disallow MPTCP subflows from sockmap
Date: Thu, 27 Nov 2025 15:45:23 +0100 [thread overview]
Message-ID: <20251127144028.077969934@linuxfoundation.org> (raw)
In-Reply-To: <20251127144027.800761504@linuxfoundation.org>
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <jiayuan.chen@linux.dev>
commit fbade4bd08ba52cbc74a71c4e86e736f059f99f7 upstream.
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: cec37a6e41aa ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/subflow.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -2095,6 +2095,10 @@ void __init mptcp_subflow_init(void)
tcp_prot_override = tcp_prot;
tcp_prot_override.release_cb = tcp_release_cb_override;
tcp_prot_override.diag_destroy = tcp_abort_override;
+#ifdef CONFIG_BPF_SYSCALL
+ /* Disable sockmap processing for subflows */
+ tcp_prot_override.psock_update_sk_prot = NULL;
+#endif
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
/* In struct mptcp_subflow_request_sock, we assume the TCP request sock
@@ -2132,6 +2136,10 @@ void __init mptcp_subflow_init(void)
tcpv6_prot_override = tcpv6_prot;
tcpv6_prot_override.release_cb = tcp_release_cb_override;
tcpv6_prot_override.diag_destroy = tcp_abort_override;
+#ifdef CONFIG_BPF_SYSCALL
+ /* Disable sockmap processing for subflows */
+ tcpv6_prot_override.psock_update_sk_prot = NULL;
+#endif
#endif
mptcp_diag_subflow_init(&subflow_ulp_ops);
next prev parent reply other threads:[~2025-11-27 14:48 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 14:45 [PATCH 6.6 00/86] 6.6.118-rc1 review Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 01/86] timers: Fix NULL function pointer race in timer_shutdown_sync() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 02/86] HID: quirks: work around VID/PID conflict for 0x4c4a/0x4155 Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 03/86] mtd: rawnand: cadence: fix DMA device NULL pointer dereference Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 04/86] mtdchar: fix integer overflow in read/write ioctls Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 05/86] shmem: fix tmpfs reconfiguration (remount) when noswap is set Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 06/86] exfat: check return value of sb_min_blocksize in exfat_read_boot_sector Greg Kroah-Hartman
2025-11-27 14:45 ` Greg Kroah-Hartman [this message]
2025-11-27 14:45 ` [PATCH 6.6 08/86] mptcp: Fix proto fallback detection with BPF Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 09/86] ata: libata-scsi: Fix system suspend for a security locked drive Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 10/86] MIPS: mm: Prevent a TLB shutdown on initial uniquification Greg Kroah-Hartman
2025-11-28 6:09 ` Maciej W. Rozycki
2025-11-27 14:45 ` [PATCH 6.6 11/86] smb: client: introduce close_cached_dir_locked() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 12/86] ata: libata-scsi: Add missing scsi_device_put() in ata_scsi_dev_rescan() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 13/86] be2net: pass wrb_params in case of OS2BMC Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 14/86] net: dsa: microchip: lan937x: Fix RGMII delay tuning Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 15/86] Revert "drm/tegra: dsi: Clear enable register if powered by bootloader" Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 16/86] Input: cros_ec_keyb - fix an invalid memory access Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 17/86] Input: goodix - add support for ACPI ID GDIX1003 Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 18/86] Input: imx_sc_key - fix memory corruption on unload Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 19/86] Input: pegasus-notetaker - fix potential out-of-bounds access Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 20/86] nouveau/firmware: Add missing kfree() of nvkm_falcon_fw::boot Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 21/86] nvme: nvme-fc: move tagset removal to nvme_fc_delete_ctrl() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 22/86] nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 23/86] scsi: sg: Do not sleep in atomic context Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 24/86] scsi: target: tcm_loop: Fix segfault in tcm_loop_tpg_address_show() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 25/86] MIPS: Malta: Fix !EVA SOC-it PCI MMIO Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 26/86] dt-bindings: pinctrl: toshiba,visconti: Fix number of items in groups Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 27/86] LoongArch: Dont panic if no valid cache info for PCI Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 28/86] mptcp: fix race condition in mptcp_schedule_work() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 29/86] mptcp: fix ack generation for fallback msk Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 30/86] mptcp: fix premature close in case of fallback Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 31/86] mptcp: avoid unneeded subflow-level drops Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 32/86] mptcp: decouple mptcp fastclose from tcp close Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 33/86] mptcp: do not fallback when OoO is present Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 34/86] drm/tegra: dc: Fix reference leak in tegra_dc_couple() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 35/86] drm/amdgpu: Skip emit de meta data on gfx11 with rs64 enabled Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 36/86] drm/amd/display: Increase DPCD read retries Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 37/86] drm/amd/display: Move sleep into each retry for retrieve_link_cap() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 38/86] xfrm: Determine inner GSO type from packet inner protocol Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 39/86] xfrm: Prevent locally generated packets from direct output in tunnel mode Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 40/86] pinctrl: cirrus: Fix fwnode leak in cs42l43_pin_probe() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 41/86] mlxsw: spectrum: Fix memory leak in mlxsw_sp_flower_stats() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 42/86] drm/tegra: Add call to put_pid() Greg Kroah-Hartman
2025-11-27 14:45 ` [PATCH 6.6 43/86] net: dsa: hellcreek: fix missing error handling in LED registration Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 44/86] net: mlxsw: linecards: fix missing error check in mlxsw_linecard_devlink_info_get() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 45/86] net: openvswitch: remove never-working support for setting nsh fields Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 46/86] nvme-multipath: fix lockdep WARN due to partition scan work Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 47/86] s390/ctcm: Fix double-kfree Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 48/86] platform/x86/intel/speed_select_if: Convert PCIBIOS_* return codes to errnos Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 49/86] kernel.h: Move ARRAY_SIZE() to a separate header Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 50/86] net: qlogic/qede: fix potential out-of-bounds read in qede_tpa_cont() and qede_tpa_end() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 51/86] pinctrl: s32cc: fix uninitialized memory in s32_pinctrl_desc Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 52/86] pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 53/86] devlink: rate: Unset parent pointer in devl_rate_nodes_destroy Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 54/86] net/mlx5: Clean up only new IRQ glue on request_irq() failure Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 55/86] LoongArch: Use UAPI types in ptrace UAPI header Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 56/86] cifs: fix memory leak in smb3_fs_context_parse_param error path Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 57/86] vsock: Ignore signal/timeout on connect() if already established Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 58/86] bcma: dont register devices disabled in OF Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 59/86] cifs: fix typo in enable_gcm_256 module parameter Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 60/86] scsi: core: Fix a regression triggered by scsi_host_busy() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 61/86] x86/microcode/AMD: Limit Entrysign signature checking to known generations Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 62/86] selftests: net: use BASH for bareudp testing Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 63/86] net: tls: Cancel RX async resync request on rcd_delta overflow Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 64/86] kconfig/mconf: Initialize the default locale at startup Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 65/86] kconfig/nconf: " Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 66/86] f2fs: compress: change the first parameter of page_array_{alloc,free} to sbi Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 67/86] s390/mm: Fix __ptep_rdp() inline assembly Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 68/86] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 69/86] ALSA: usb-audio: fix uac2 clock source at terminal parser Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 70/86] net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 71/86] tracing/tools: Fix incorrcet short option in usage text for --threads Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 72/86] smb: client: fix incomplete backport in cfids_invalidation_worker() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 73/86] KVM: arm64: Check the untrusted offset in FF-A memory share Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 74/86] uio_hv_generic: Set event for all channels on the device Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 75/86] maple_tree: fix tracepoint string pointers Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 76/86] wifi: cfg80211: Add missing lock in cfg80211_check_and_end_cac() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 77/86] crash: fix crashkernel resource shrink Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 78/86] ftrace: Fix BPF fexit with livepatch Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 79/86] pmdomain: arm: scmi: Fix genpd leak on provider registration failure Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 80/86] pmdomain: imx-gpc: Convert to platform remove callback returning void Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 81/86] pmdomain: imx: Fix reference count leak in imx_gpc_remove Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 82/86] selftests: mptcp: join: endpoints: longer transfer Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 83/86] HID: amd_sfh: Stop sensor before starting Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 84/86] mm/mempool: replace kmap_atomic() with kmap_local_page() Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 85/86] mm/mempool: fix poisoning order>0 pages with HIGHMEM Greg Kroah-Hartman
2025-11-27 14:46 ` [PATCH 6.6 86/86] mptcp: fix a race in mptcp_pm_del_add_timer() Greg Kroah-Hartman
2025-11-27 17:10 ` [PATCH 6.6 00/86] 6.6.118-rc1 review Peter Schneider
2025-11-27 17:29 ` Brett A C Sheffield
2025-11-28 8:43 ` Ron Economos
2025-11-28 10:16 ` Naresh Kamboju
2025-11-29 1:02 ` Mark Brown
2025-11-29 17:43 ` Florian Fainelli
2025-12-01 18:18 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251127144028.077969934@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=jiayuan.chen@linux.dev \
--cc=martin.lau@kernel.org \
--cc=matttbe@kernel.org \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).