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)
committerLorenzo Colitti <lorenzo@google.com>
Sun, 18 Sep 2016 16:51:21 +0000 (01:51 +0900)
commitecd02bbc43641454b940fcf9c16b39ab8179af67
tree5744a66093de526fb7290e856248da9bfc09b1ba
parent5bd0c83ba48ce73eb89bd4308b07a263a07dd21e
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