[PATCH net-next 0/2] tcp: ulp: diag: expose more to non net admin users

From: Matthieu Baerts (NGI0)
Date: Thu Mar 06 2025 - 06:30:39 EST


Since its introduction in commit 61723b393292 ("tcp: ulp: add functions
to dump ulp-specific information"), the ULP diag info have been exported
only to users with CAP_NET_ADMIN capability.

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.

First, the ULP name can be easily exported. Then more depending on each
layer:

- On kTLS side, it looks like everything can be exported to all users:
version, cipher type, tx/rx user config type, plus some flags.

- On MPTCP side, everything but the sequence numbers are exported to
all non net admin users, similar to TCP.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
---
Matthieu Baerts (NGI0) (2):
tcp: ulp: diag: always print the name if any
tcp: ulp: diag: more info without CAP_NET_ADMIN

include/net/tcp.h | 4 ++--
net/ipv4/tcp_diag.c | 21 ++++++++++-----------
net/mptcp/diag.c | 42 ++++++++++++++++++++++++++----------------
net/tls/tls_main.c | 4 ++--
4 files changed, 40 insertions(+), 31 deletions(-)
---
base-commit: f130a0cc1b4ff1ef28a307428d40436032e2b66e
change-id: 20250306-net-next-tcp-ulp-diag-net-admin-a1d6d7f9910b

Best regards,
--
Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>