[PATCH mptcp-net v14] mptcp: hide sequence numbers in Netlink diagnostics

Kalpan Jani posted 1 patch 14 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20261123054324.561321-1-kalpan.jani@mpiricsoftware.com
net/mptcp/mptcp_diag.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH mptcp-net v14] mptcp: hide sequence numbers in Netlink diagnostics
Posted by Kalpan Jani 14 hours ago
TCP sequence numbers are not exposed through TCP diagnostics to
prevent other users on the same machine from obtaining information
that could be used to interfere with existing connections by
injecting specific packets.

MPTCP Netlink diagnostics currently expose data-level sequence
numbers through INET_DIAG_INFO.

Clear mptcpi_write_seq, mptcpi_snd_una and mptcpi_rcv_nxt in
mptcp_diag_get_info() to prevent these values from being exposed
through Netlink diagnostics.

Ideally, these fields would only be hidden from unprivileged
requesters. However, the current diagnostic callback does not
provide the privilege information needed to distinguish requesters.
Therefore, these fields are cleared for all requesters, including
privileged users.

The getsockopt(MPTCP_INFO) and getsockopt(MPTCP_FULL_INFO)
interfaces remain unchanged and continue to report the actual
sequence numbers.

Fixes: ac3b45f60954 ("mptcp: add MPTCP socket diag interface")
Link: https://github.com/multipath-tcp/mptcp_net-next/issues/445
Signed-off-by: Kalpan Jani <kalpan.jani@mpiricsoftware.com>
---
Changes since v13:
- Remove the additional selftest for zero sequence-number fields following maintainer feedback.
- Clarify the security motivation for hiding MPTCP sequence numbers in Netlink diagnostics.
- Explain why sequence-number fields are cleared for all Netlink requesters, including privileged users.
- Preserve the existing getsockopt() behaviour.

v13: https://lore.kernel.org/all/20261117050804.134954-1-kalpan.jani@mpiricsoftware.com/
---

 net/mptcp/mptcp_diag.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mptcp/mptcp_diag.c b/net/mptcp/mptcp_diag.c
index 136c2d05c0eeb..fe1603ce80162 100644
--- a/net/mptcp/mptcp_diag.c
+++ b/net/mptcp/mptcp_diag.c
@@ -215,6 +215,10 @@ static void mptcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
 		return;
 
 	mptcp_diag_fill_info(msk, info);
+
+	info->mptcpi_write_seq = 0;
+	info->mptcpi_snd_una = 0;
+	info->mptcpi_rcv_nxt = 0;
 }
 
 static const struct inet_diag_handler mptcp_diag_handler = {
-- 
2.43.0
Re: [PATCH mptcp-net v14] mptcp: hide sequence numbers in Netlink diagnostics
Posted by MPTCP CI 12 hours ago
Hi Kalpan,

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! ✅
- Perf: Unstable: 2 failed test(s): regression:sched-baseline(4) regression:sched-serverlim(4) ⚠️  (4 improvements, 105 new outliers to review)
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/45121968870

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


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)