net: diag: allow socket bytecode filters to match socket marks
authorLorenzo Colitti <lorenzo@google.com>
Wed, 24 Aug 2016 06:46:26 +0000 (15:46 +0900)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Aug 2016 04:57:20 +0000 (21:57 -0700)
commita52e95abf772b43c9226e9a72d3c1353903ba96f
tree92e3d29500ba58f2069f70a064d224f299a4a4b0
parent627cc4add53c0470bfd118002669205d222d3a54
net: diag: allow socket bytecode filters to match socket marks

This allows a privileged process to filter by socket mark when
dumping sockets via INET_DIAG_BY_FAMILY. This is useful on
systems that use mark-based routing such as Android.

The ability to filter socket marks requires CAP_NET_ADMIN, which
is consistent with other privileged operations allowed by the
SOCK_DIAG interface such as the ability to destroy sockets and
the ability to inspect BPF filters attached to packet sockets.

Tested: https://android-review.googlesource.com/261350
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/inet_diag.h
net/ipv4/inet_diag.c