net/unix: don't show information about sockets from other namespaces
authorAndrei Vagin <avagin@openvz.org>
Wed, 25 Oct 2017 17:16:42 +0000 (10:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:22:22 +0000 (11:22 +0100)
commit62de3fe46c6b11ad3db086615dd3d46a35e7b06d
tree55ed502418c8d76d9da15f19892417836da6f212
parent2af59c6557a5f5e18b5552fe8526033b032978d5
net/unix: don't show information about sockets from other namespaces

[ Upstream commit 0f5da659d8f1810f44de14acf2c80cd6499623a0 ]

socket_diag shows information only about sockets from a namespace where
a diag socket lives.

But if we request information about one unix socket, the kernel don't
check that its netns is matched with a diag socket namespace, so any
user can get information about any unix socket in a system. This looks
like a bug.

v2: add a Fixes tag

Fixes: 51d7cccf0723 ("net: make sock diag per-namespace")
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/unix/diag.c