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)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 12 Oct 2016 12:04:22 +0000 (17:34 +0530)
commit65aad0e5bee187ebd08526ae5faa120b002cf1bb
treec2e9c0c2075a81331ed4bf8b3db0a88be18121fc
parente10225d940a6a5c4da393487129e4f0938f5402f
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.

[cherry-pick of a52e95abf772b43c9226e9a72d3c1353903ba96f]

Change-Id: I8b90b814264d9808bda050cdba8f104943bdb9a8
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