]> www.infradead.org Git - users/hch/misc.git/commit
tcp: ulp: diag: more info without CAP_NET_ADMIN
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Thu, 6 Mar 2025 11:29:28 +0000 (12:29 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Mar 2025 03:39:53 +0000 (19:39 -0800)
commit0d7336f8f06d4a1a1e2c62624d086561e8490bb7
treeef4fff5f2a7371f48ba721ae92e8ab4a22583564
parentf5afcb9fbb3984137feb12cb2d2fc6986a8347ac
tcp: ulp: diag: more info without CAP_NET_ADMIN

When introduced in commit 61723b393292 ("tcp: ulp: add functions to dump
ulp-specific information"), the whole ULP diag info has been exported
only if the requester had CAP_NET_ADMIN.

It looks like not everything is sensitive, and some info can be exported
to all users in order to ease the debugging from the userspace side
without requiring additional capabilities. Each layer should then decide
what can be exposed to everybody. The 'net_admin' boolean is then passed
to the different layers.

On kTLS side, it looks like there is nothing sensitive there: version,
cipher type, tx/rx user config type, plus some flags. So, only some
metadata about the configuration, no cryptographic info like keys, etc.
Then, everything can be exported to all users.

On MPTCP side, that's different. The MPTCP-related sequence numbers per
subflow should certainly not be exposed to everybody. For example, the
DSS mapping and ssn_offset would give all users on the system access to
narrow ranges of values for the subflow TCP sequence numbers and
MPTCP-level DSNs, and then ease packet injection. The TCP diag interface
doesn't expose the TCP sequence numbers for TCP sockets, so best to do
the same here. The rest -- token, IDs, flags -- can be exported to
everybody.

Acked-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250306-net-next-tcp-ulp-diag-net-admin-v1-2-06afdd860fc9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h
net/ipv4/tcp_diag.c
net/mptcp/diag.c
net/tls/tls_main.c