]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
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)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 23 Mar 2017 19:34:58 +0000 (12:34 -0700)
commit0e63860134f4a9cf9cc4662d81f633c9b74ced34
treea784b83f5deecde1cf7b95a2b9f7cf1832a265cb
parentaaa6c3eadf984f368dd85d46b290c4c8ebfaa764
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 a52e95abf772 ("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.

[backport of net-next d545caca827b65aab557a9e9dcdcf1e5a3823c2d]

bug 200281955

Change-Id: I33336ed9c3ee3fb78fe05c4c47b7fd18c6e33ef1
Tested: https://android-review.googlesource.com/270210
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-on: http://git-master/r/1321365
(cherry picked from commit 6babc1b580790f497d4de040cc65bf5c57aa28f2)
Reviewed-on: http://git-master/r/1324829
GVS: Gerrit_Virtual_Submit
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Tested-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
include/linux/inet_diag.h
include/uapi/linux/inet_diag.h
net/ipv4/inet_diag.c
net/ipv4/udp_diag.c