MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next v2 0/3] mptcp: pm: fix reachable extra_subflows guards
@ 2026-09-03 13:14 Tao Cui
  2026-09-03 13:14 ` [PATCH mptcp-next v2 1/3] mptcp: pm: bound extra_subflows admission on userspace PM Tao Cui
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Tao Cui @ 2026-09-03 13:14 UTC (permalink / raw)
  To: mptcp, matttbe, quanyeyang; +Cc: geliang, cuitao, cui.tao

From: Tao Cui <cuitao@kylinos.cn>

Hi,

Following up on issue #629, here is a fix series for the issues
reported against e99c1ca871 ("mptcp: pm: add WARN_ON_ONCE guards
on extra_subflows underflow").

Patch 1 bounds the userspace PM admission at U8_MAX, so the u8 can
no longer be wrapped by a peer establishing more than 255 subflows.

Patch 2 addresses the disconnect() vs MP_JOIN race: as discussed,
the decrement sites now check the msk state first and skip the
accounting when the msk is already in TCP_CLOSE, as the state is set
before mptcp_pm_data_reset() clears the counters, and once the msk
is closed the accounting is not relevant anymore. No new lock is
involved. The guards themselves are downgraded to a clamp with a
rate-limited pr_warn(), as the warn was reachable and turned into a
remotely triggerable panic on panic_on_warn kernels.

Patch 3, from Quanye, applies the same bound to the Netlink subflow
creation path, with a goto to the error cleanup as suggested during
the review.

Changes since v1 [1]:

- Patch 1: re-use "ret" instead of a new variable, drop the
  comment, Co-developed-by added for Quanye, who sent the same fix
  independently
- issue reference: Link: on patches 1 and 2, Closes: on the last one
- New patch 3 from Quanye for the Netlink path, per the discussion
  with Matt [2]

Validated with the virtme CI (mptcp selftests), and with a stress
repro comparing the base kernel and the patched one: on the base
kernel the server accepts 256 MP_JOINs and the counter wraps to 0,
with the patches admission stops at 255 and the leftover imbalance
only shows up as a rate-limited warning.

[1] https://lore.kernel.org/20260831093206.689827-1-cui.tao@linux.dev/
[2] https://lore.kernel.org/all/c8c4f667-5d25-4d94-8627-387d4091c8c4@kernel.org/

Quanye Yang (1):
  mptcp: pm: userspace: cap extra_subflows on Netlink subflow creation

Tao Cui (2):
  mptcp: pm: bound extra_subflows admission on userspace PM
  mptcp: pm: skip extra_subflows accounting on disconnected msk

 net/mptcp/pm.c           | 17 ++++++++++++++---
 net/mptcp/pm_userspace.c | 10 +++++++++-
 net/mptcp/protocol.h     | 14 ++++++++++++--
 3 files changed, 35 insertions(+), 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-03 14:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 13:14 [PATCH mptcp-next v2 0/3] mptcp: pm: fix reachable extra_subflows guards Tao Cui
2026-09-03 13:14 ` [PATCH mptcp-next v2 1/3] mptcp: pm: bound extra_subflows admission on userspace PM Tao Cui
2026-09-03 13:14 ` [PATCH mptcp-next v2 2/3] mptcp: pm: skip extra_subflows accounting on disconnected msk Tao Cui
2026-09-03 13:14 ` [PATCH mptcp-next v2 3/3] mptcp: pm: userspace: cap extra_subflows on Netlink subflow creation Tao Cui
2026-09-03 13:27   ` sashiko-bot
2026-09-03 14:08     ` Matthieu Baerts
2026-09-03 14:13   ` Matthieu Baerts
2026-09-03 14:21 ` [PATCH mptcp-next v2 0/3] mptcp: pm: fix reachable extra_subflows guards MPTCP CI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox