lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 14 Dec 2014 19:23:18 +0200
From:	Vadim Kochan <>
Cc:	Vadim Kochan <>
Subject: [PATCH iproute2 REGRESSION v2] ss: Dont show netlink and packet sockets by default

From: Vadim Kochan <>

Checking by SS_CLOSE state was remowed in:

    (45a4770bc0) ss: Remove checking SS_CLOSE state for packet and netlink

which is not really correct because now by default all sockets are seen
when do 'ss'.

Here is most correct fix which considers specified family.

To see netlink sockets:
    ss -A netlink

To see packet sockets:
    ss -A packet

And ss by default will show only connected/established sockets as it
was before all the time.

Signed-off-by: Vadim Kochan <>
 misc/ss.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/misc/ss.c b/misc/ss.c
index e9927a5..8f39eb8 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2801,6 +2801,9 @@ static int packet_show(struct filter *f)
 	int ino;
 	unsigned long long sk;
+	if (preferred_family != AF_PACKET && !(f->states & (1 << SS_CLOSE)))
+		return 0;
 	if (packet_show_netlink(f, NULL) == 0)
 		return 0;
@@ -3028,6 +3031,9 @@ static int netlink_show(struct filter *f)
 	int rq, wq, rc;
 	unsigned long long sk, cb;
+	if (preferred_family != AF_NETLINK && !(f->states & (1 << SS_CLOSE)))
+		return 0;
 	if (!getenv("PROC_NET_NETLINK") && !getenv("PROC_ROOT") &&
 		netlink_show_netlink(f, NULL) == 0)
 		return 0;

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists