milos-linux/net/mptcp
Matthieu Baerts (NGI0) bd34fa0257 mptcp: add-addr: always drop other suboptions
When an ADD_ADDR needs to be sent, it could be prepared if there is
enough remaining space and even if the packet is not a pure ACK. But it
would be dropped soon after.

Indeed, in mptcp_pm_add_addr_signal(), there is enough space to fit a
DSS of 20 octets and an ADD_ADDR echo containing an IPv4 address on 8
octets for example. In this case, the packet would be prepared, the
MPTCP_ADD_ADDR_ECHO bit would be removed from pm->addr_signal, but the
option would be silently dropped in mptcp_established_options_add_addr()
not to override DSS info in the union from 'struct mptcp_out_options',
and also because mptcp_write_options() will enforce mutually exclusion
with DSS.

Instead, don't even try to send an ADD_ADDR if it is not a pure ACK.
Retry for each new packet until a pure-ACK is emitted. That's fine to do
that, because each time an ADD_ADDR (echo) is scheduled, a pure ACK is
queued.

This also simplifies the code, and the skb checks can be done earlier,
before the lock.

Note: also, since commit 6d0060f600 ("mptcp: Write MPTCP DSS headers
to outgoing data packets"), opts->ahmac would not have been set to 0
when other suboptions were not dropped, and when sending an ADD_ADDR
echo. That would have resulted in sending an ADD_ADDR using garbage
info, where there was not enough space, instead of an echo one without
the ADD_ADDR HMAC.

Fixes: 1bff1e43a3 ("mptcp: optimize out option generation")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-11-856831229976@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-03 19:04:27 -07:00
..
bpf.c mptcp: bpf: Fix type confusion in bpf_mptcp_sock_from_subflow() 2026-05-08 11:38:10 -07:00
crypto.c mptcp: use HMAC-SHA256 library instead of open-coded HMAC 2025-09-03 15:08:20 -07:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
ctrl.c mptcp: reset blackhole on success with non-loopback ifaces 2025-09-19 07:06:19 -07:00
diag.c tcp: ulp: diag: more info without CAP_NET_ADMIN 2025-03-07 19:39:53 -08:00
fastopen.c mptcp: fix rx timestamp corruption on fastopen 2026-05-04 19:20:50 -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: borrow forward memory from subflow 2025-11-24 19:49:42 -08:00
mib.h mptcp: borrow forward memory from subflow 2025-11-24 19:49:42 -08: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: add-addr: always drop other suboptions 2026-06-03 19:04:27 -07:00
pm.c mptcp: add-addr: always drop other suboptions 2026-06-03 19:04:27 -07:00
pm_kernel.c mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0 2026-05-06 18:16:44 -07:00
pm_netlink.c mptcp: pm: ignore unknown endpoint flags 2025-12-08 23:54:02 -08:00
pm_userspace.c mptcp: pm: fix extra_subflows underflow on userspace PM subflow creation 2026-06-03 19:04:26 -07:00
protocol.c mptcp: check desc->count in read_sock 2026-06-03 19:04:26 -07:00
protocol.h mptcp: add-addr: always drop other suboptions 2026-06-03 19:04:27 -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: use MPTCP_RST_EMPTCP for ACK HMAC validation failure 2026-05-04 19:20:50 -07:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token.c mptcp: fix kdoc warnings 2026-02-06 20:35:06 -08:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00