net: inet: diag: expose the socket mark to privileged processes.
authorLorenzo Colitti <lorenzo@google.com>
Wed, 7 Sep 2016 15:42:25 +0000 (00:42 +0900)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Sep 2016 23:13:09 +0000 (16:13 -0700)
commitc6d3bf521b084ff9b1a4c7241fe8f7e8009623dd
tree1ec87b39e2490acc3f435d650d6ddc6e594300cf
parent40f9297682e63cebe56e66571903291c49f0bb63
net: inet: diag: expose the socket mark to privileged processes.

This adds the capability for a process that has CAP_NET_ADMIN on
a socket to see the socket mark in socket dumps.

Commit bfdb40a43b2d ("net: diag: allow socket bytecode filters to
match socket marks") recently gave privileged processes the
ability to filter socket dumps based on mark. This patch is
complementary: it ensures that the mark is also passed to
userspace in the socket's netlink attributes.  It is useful for
tools like ss which display information about sockets.

Tested: https://android-review.googlesource.com/270210
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/inet_diag.h
include/uapi/linux/inet_diag.h
net/ipv4/inet_diag.c
net/ipv4/udp_diag.c
net/sctp/sctp_diag.c