linux/net/mptcp
Harshit Varu b878dfdd12 mptcp: fix uninitialized local_id in syncookie MP_JOIN reconstruction
mptcp_token_join_cookie_init_state() restores remote_nonce, local_nonce,
backup, join_id, token and msk from the saved cookie entry when rebuilding
the request socket for a MP_JOIN 4th-ACK handled under SYN cookies, but it
does not restore local_id, even though the SYN path saved it.
subflow_ulp_clone() then reads that uninitialized field and stores it as
the joined subflow's address-ID. Because the request-sock slab is
SLAB_TYPESAFE_BY_RCU and not zeroed on allocation, the value is the stale
byte of a previously freed request socket, which an off-path peer can
influence by sending concurrent MP_JOIN SYNs. This corrupts the path
manager's id-based subflow bookkeeping for the connection.

Restore subflow_req->local_id from the cookie entry, as done for the other
fields.

Fixes: 9466a1cceb ("mptcp: enable JOIN requests even if cookies are in use")
Cc: stable@vger.kernel.org
Signed-off-by: Harshit Varu <harshitvaru666@gmail.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260815115205.197151-1-harshitvaru666@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-20 12:53:14 -07:00
..
bpf.c mptcp: bpf: Fix type confusion in bpf_mptcp_sock_from_subflow() 2026-05-08 11:38:10 -07:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
crypto.c mptcp: use HMAC-SHA256 library instead of open-coded HMAC 2025-09-03 15:08:20 -07:00
ctrl.c mptcp: introduce add_addr_v6_port_drop_ts sysctl knob 2026-06-11 15:33:37 -07:00
diag.c tcp: ulp: diag: more info without CAP_NET_ADMIN 2025-03-07 19:39:53 -08:00
fastopen.c mptcp: fastopen: only mark MPTFO subflows with SYN data 2026-08-06 08:46:23 -07:00
Kconfig mptcp: select CRYPTO_LIB_UTILS instead of CRYPTO 2025-12-08 23:44:16 -08:00
Makefile mptcp: pm: split in-kernel PM specific code 2025-03-10 13:35:50 -07:00
mib.c mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
mib.h mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
mptcp_diag.c mptcp: introduce mptcp-level backlog 2025-11-24 19:49:43 -08:00
mptcp_pm_gen.c tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
mptcp_pm_gen.h tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
options.c mptcp: explicitly drop over memory limits 2026-08-11 18:35:37 -07:00
pm_kernel.c mptcp: pm: uniform announced addresses helpers 2026-06-11 15:33:38 -07:00
pm_netlink.c mptcp: pm: ignore unknown endpoint flags 2025-12-08 23:54:02 -08:00
pm_userspace.c mptcp: pm: userspace: make remove_addr_entry static 2026-08-17 17:25:49 -07:00
pm.c mptcp: pm: add WARN_ON_ONCE guards on extra_subflows underflow 2026-08-17 17:25:49 -07:00
protocol.c mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
protocol.h mptcp: pm: userspace: make remove_addr_entry static 2026-08-17 17:25:49 -07:00
sched.c mptcp: sched: split validation part 2025-04-15 08:21:46 -07:00
sockopt.c mptcp: sockopt: set sockopt on all subflows 2026-06-03 19:04:26 -07:00
subflow.c mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
syncookies.c mptcp: fix uninitialized local_id in syncookie MP_JOIN reconstruction 2026-08-20 12:53:14 -07:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00
token.c mptcp: fix kdoc warnings 2026-02-06 20:35:06 -08:00