Skip to content

ss fixes from an OSS scan

Stephen Hemminger netdev 1 version Applied

Status from this message: This series was applied to iproute2/iproute2.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 0 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/11ss: fix double close on sock_diag send failuremisc/ss.c+1 -40 replies
2/11ss: drop /proc fallback for socket listingmisc/ss.c+28 -5980 replies
3/11ss: escape names chosen by the socket ownerlib/escape.c misc/ss.c+15 -50 replies
4/11ss: size the TCPDIAG_FILE buffer to the recordmisc/ss.c+35 -50 replies
5/11ss: replay all dumps in TCPDIAG_FILEmisc/ss.c testsuite/tests/ss/ssfilter.t+32 -120 replies
6/11ss: bound state and type name lookupsmisc/ss.c+22 -210 replies
7/11ss: fix rpcbind service cachemisc/ss.c+26 -180 replies
8/11ss: read socket SELinux context only for -zmisc/ss.c+34 -10 replies
9/11ss: check owner before naming a netlink socketman/man8/ss.8 misc/ss.c+48 -60 replies
10/11ss: keep following events after ENOBUFSmisc/ss.c+7 -20 replies
11/11ss: report a failed SCTP or MPTCP dumpmisc/ss.c+4 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH iproute2 00/11] ss fixes from an OSS scan

Fixes for the ss findings of scan iproute2-20261015-004, plus bugs found while confirming them.

The biggest change is removing the fallback /proc parsing.
It was buggy and fixing it is not worth bothering.
Every family ss lists that way has had sock_diag support since well before the oldest supported LTS kernel, and the parsers were untested and trusted file contents that an unprivileged user can partly control. A kernel built without netlink socket diagnostics now gets an error instead of a silent fallback.

The rest escape names chosen by whoever owns the socket, bound state and type values from the kernel before indexing name tables, stop treating a netlink port id as the owner's pid, and size the TCPDIAG_FILE read buffer to the record while rejecting lengths the parser cannot use.

Stephen Hemminger (11):
ss: fix double close on sock_diag send failure
ss: drop /proc fallback for socket listing
ss: escape names chosen by the socket owner
ss: size the TCPDIAG_FILE buffer to the record
ss: replay all dumps in TCPDIAG_FILE
ss: bound state and type name lookups
ss: fix rpcbind service cache
ss: read socket SELinux context only for -z
ss: check owner before naming a netlink socket
ss: keep following events after ENOBUFS
ss: report a failed SCTP or MPTCP dump

 lib/escape.c                  |   7 +-
 man/man8/ss.8                 |   3 +-
 misc/ss.c                     | 884 +++++++++-------------------------
 testsuite/tests/ss/ssfilter.t |  26 +-
 4 files changed, 249 insertions(+), 671 deletions(-)
Signature · 1 line
2.53.0