🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Matthieu Baerts Tue, 24 Nov 2026 11:17
Re: [PATCH mptcp-net] mptcp: gate diag sequence counters on CAP_NET_ADMIN
#21722
Author: Matthieu Baerts
Date: Tue, 24 Nov 2026 11:17
44 lines
12573 bytes
Hi Dominik,

(+cc Kalpan)

On 19/11/2026 20:21, Dominik Maier wrote:
> In net/mptcp/diag.c, subflow_get_info() restricts MPTCP sequence-related
> subflow attributes (rel_write_seq, map_seq, map_subflow_seq, ssn_offset)
> to callers holding CAP_NET_ADMIN in the network namespace.
> 
> However, mptcp_diag_get_info() unconditionally exports mptcpi_write_seq,
> mptcpi_snd_una, and mptcpi_rcv_nxt via INET_DIAG_INFO because
> .idiag_get_info does not receive the caller's net_admin status. Any
> unprivileged local user can therefore dump or query cross-UID MPTCP
> sockets by token via SOCK_DIAG_BY_FAMILY and read live 64-bit MPTCP Data
> Sequence Numbers.

Thank you for this patch!

> Emit INET_DIAG_INFO from an .idiag_get_aux callback in mptcp_diag (which
> already receives net_admin from inet_sk_diag_fill(), while msk never
> sets icsk_ca_ops so netlink attribute ordering is unchanged) and zero
> mptcpi_write_seq, mptcpi_snd_una, and mptcpi_rcv_nxt when !net_admin.
> getsockopt(SOL_MPTCP, MPTCP_INFO) for the socket owner and token-based
> lookup in mptcp_diag_dump_one() remain unchanged.

Oh, that's a good idea, I didn't think about .idiag_get_aux callback.

Kalpan was trying to fix the same thing:


https://lore.kernel.org/20261123054324.561321-1-kalpan.jani@mpiricsoftware.com

@Kalpan: what do you think of this? If it looks good to you, and you
tested it, can you send your Tested-by tag?

We can add:

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/445

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-net] mptcp: gate diag sequence counters on CAP_NET_ADMIN
#22389
Author: Matthieu Baerts
Date: Wed, 25 Nov 2026 08:45
29 lines
12188 bytes
Hi Kalpan,

On 25/11/2026 05:51, Kalpan Jani wrote:
> Hi Matt, Hi Dominik,
> 
> I tested the proposed change on a locally built kernel with MPTCP enabled.
> 
> Runtime testing passed for both client and server sockets:
> - Privileged Netlink requests return the actual sequence counters, matching getsockopt(MPTCP_INFO).
> - Unprivileged Netlink requests return zero for mptcpi_write_seq, mptcpi_snd_una and mptcpi_rcv_nxt.
> - Other diagnostic information remains available to unprivileged users.
> 
> The full kernel build and runtime tests completed successfully.
> 
> Tested-by: Kalpan Jani <kalpan.jani@mpiricsoftware.com>
Thank you for having tested that and your previous work!

Dominik's patch looks good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

@netdev maintainers: I see this patch is still listed on Suie, can you
please apply it in -net directly?

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

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads