From: Matthieu Baerts <matttbe@kernel.org>
To: Dominik Maier <dmnk@google.com>
Cc: Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
mptcp@lists.linux.dev, netdev@vger.kernel.org,
dmnk+artist@google.com,
Kalpan Jani <kalpan.jani@mpiricsoftware.com>
Subject: Re: [PATCH mptcp-net] mptcp: gate diag sequence counters on CAP_NET_ADMIN
Date: Tue, 24 Nov 2026 12:17:10 +0100 [thread overview]
Message-ID: <a9526d12-87db-466d-aac8-ae575559e010@kernel.org> (raw)
In-Reply-To: <20261119192159.2646113-1-dmnk@google.com>
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.
prev parent reply other threads:[~2026-11-24 11:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:21 [PATCH mptcp-net] mptcp: gate diag sequence counters on CAP_NET_ADMIN Dominik Maier
2026-11-24 11:17 ` Matthieu Baerts [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9526d12-87db-466d-aac8-ae575559e010@kernel.org \
--to=matttbe@kernel.org \
--cc=dmnk+artist@google.com \
--cc=dmnk@google.com \
--cc=geliang@kernel.org \
--cc=kalpan.jani@mpiricsoftware.com \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox