[PATCH mptcp-next 0/3] mptcp: avoid data-races around the sysctls

Gang Yan posted 3 patches 6 days, 23 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20260817012452.7519-1-gang.yan@linux.dev
There is a newer version of this series
net/mptcp/ctrl.c     | 116 ++++++++++++++++++++++++++++++-------------
net/mptcp/pm.c       |   3 +-
net/mptcp/protocol.c |   5 +-
net/mptcp/protocol.h |   6 +--
net/mptcp/sched.c    |   2 +-
5 files changed, 91 insertions(+), 41 deletions(-)
[PATCH mptcp-next 0/3] mptcp: avoid data-races around the sysctls
Posted by Gang Yan 6 days, 23 hours ago
From: Gang Yan <yangang@kylinos.cn>

Hi,

As decribed in [1], this series is for addressing the KCSAN issues in
sysctls.

Following the tcp_congestion_control() model, patch 1 and 2 now store
pointers to the immutable ops and swap them atomically via xchg().

Patch 3 (from Matthieu) covers the remaining scalar sysctls with READ_ONCE().

[1] https://github.com/multipath-tcp/mptcp_net-next/issues/626

Gang Yan (2):
  mptcp: sched: change scheduler sysctl atomically
  mptcp: pm: change path_manager sysctl atomically

Matthieu Baerts (NGI0) (1):
  mptcp: use READ_ONCE() over sysctls

 net/mptcp/ctrl.c     | 116 ++++++++++++++++++++++++++++++-------------
 net/mptcp/pm.c       |   3 +-
 net/mptcp/protocol.c |   5 +-
 net/mptcp/protocol.h |   6 +--
 net/mptcp/sched.c    |   2 +-
 5 files changed, 91 insertions(+), 41 deletions(-)

-- 
2.43.0
Re: [PATCH mptcp-next 0/3] mptcp: avoid data-races around the sysctls
Posted by Matthieu Baerts 6 days, 6 hours ago
Hi Gang Yan,

On 17/08/2026 03:24, Gang Yan wrote:
> From: Gang Yan <yangang@kylinos.cn>
> 
> Hi,
> 
> As decribed in [1], this series is for addressing the KCSAN issues in
> sysctls.
> 
> Following the tcp_congestion_control() model, patch 1 and 2 now store
> pointers to the immutable ops and swap them atomically via xchg().
> 
> Patch 3 (from Matthieu) covers the remaining scalar sysctls with READ_ONCE().
> 
> [1] https://github.com/multipath-tcp/mptcp_net-next/issues/626

Thank you for looking at that with Tao Cui.

Globally, it looks good to me, but I have a few small requests:

- Do you mind resending this series, please: for some unknown reasons,
  Sashiko didn't get it. But before: ↓

- Can you not add Eric in Cc of the 3rd patch? Better not to spam him
for dev work → b4 send --no-trailer-to-cc ; or: git send-email
--suppress-cc=misc-by

- Could you split the code around bpf module support? I guess these
patches will be sent before adding BPF PM/sched support. In this case,
you would have squash-to patches for the BPF parts at the end of the series.

- I think you can move the WRITE_ONCE(pernet->pm_type, pm_type); from
  current patch 2 to 3, with Tao Cui's Co-dev.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.

Re: [PATCH mptcp-next 0/3] mptcp: avoid data-races around the sysctls
Posted by MPTCP CI 6 days, 22 hours ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/31986048689

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/fa35ee6d384f
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1146872


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)