Skip to content

net: tls: add socket diag

Davide Caratti netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- remove unneeded #ifdef and fix reverse christmas tree in tls_get_info(), thanks to Jakub Kicinski

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net/tls: use RCU protection on icsk->icsk_ulp_datainclude/net/inet_connection_sock.h include/net/tls.h net/core/sock_map.c +2 more+29 -120 replies
2/3tcp: ulp: add functions to dump ulp-specific informationinclude/net/tcp.h include/uapi/linux/inet_diag.h net/ipv4/tcp_diag.c+62 -10 replies
3/3net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diaginclude/net/tls.h include/uapi/linux/inet_diag.h include/uapi/linux/tls.h +1 more+97 -01 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchJakub Kicinski
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/3] net: tls: add socket diag

The current kernel does not provide any diagnostic tool, except getsockopt(TCP_ULP), to know more about TCP sockets that have an upper layer protocol (ULP) on top of them. This series extends the set of information exported by INET_DIAG_INFO, to include data that are specific to the ULP (and that might be meaningful for debug/testing purposes).

patch 1/3 ensures that the control plane reads/updates ULP specific data using RCU.

patch 2/3 extends INET_DIAG_INFO and allows knowing the ULP name for each TCP socket that has done setsockopt(TCP_ULP) successfully.

patch 3/3 extends kTLS to let programs like 'ss' know the protocol version and the cipher in use.

Changes since v2:
- remove unneeded #ifdef and fix reverse christmas tree in tls_get_info(), thanks to Jakub Kicinski

Changes since v1:
- don't worry about grace period when accessing ulp_ops, thanks to Jakub Kicinski and Eric Dumazet
- use rcu_dereference() to access ULP data in tls get_info(), and test against NULL value, thanks to Jakub Kicinski
- move RCU protected section inside tls get_info(), thanks to Jakub Kicinski

Changes since RFC:
- some coding style fixes, thanks to Jakub Kicinski
- add X_UNSPEC as lowest value of uAPI enums, thanks to Jakub Kicinski
- fix assignment of struct nlattr *start, thanks to Jakub Kicinski
- let tls dump RXCONF and TXCONF, suggested by Jakub Kicinski
- don't dump anything if TLS version or cipher are 0 (but still return a constant size in get_aux_size()), thanks to Boris Pismenny
- constify first argument of get_info() and get_size()
- use RCU to access access ulp_ops, like it's done for ca_ops
- add patch 1/3, from Jakub Kicinski

Davide Caratti (2):
tcp: ulp: add functions to dump ulp-specific information
net: tls: export protocol version, cipher, tx_conf/rx_conf to socket
diag

Jakub Kicinski (1):
net/tls: use RCU protection on icsk->icsk_ulp_data

 include/net/inet_connection_sock.h |  2 +-
 include/net/tcp.h                  |  3 +
 include/net/tls.h                  | 26 ++++++++-
 include/uapi/linux/inet_diag.h     |  9 +++
 include/uapi/linux/tls.h           | 15 +++++
 net/core/sock_map.c                |  2 +-
 net/ipv4/tcp_diag.c                | 52 ++++++++++++++++-
 net/tls/tls_device.c               |  2 +-
 net/tls/tls_main.c                 | 90 +++++++++++++++++++++++++++---
 9 files changed, 188 insertions(+), 13 deletions(-)
Signature · 1 line
2.20.1