net: Fix ns_capable check in sock_diag_put_filterinfo
authorAndrew Lutomirski <luto@amacapital.net>
Thu, 17 Apr 2014 04:41:34 +0000 (21:41 -0700)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:49:17 +0000 (11:49 +0200)
commit6bebcc8d95669e32c9ac6e836e985ae50392ae23
tree8979a19a4ad30347aa28a1827152815ddfb029e0
parent88830f227a1f96e44d82ddfcb0cc81d517ec6dd8
net: Fix ns_capable check in sock_diag_put_filterinfo

[ Upstream commit 78541c1dc60b65ecfce5a6a096fc260219d6784e ]

The caller needs capabilities on the namespace being queried, not on
their own namespace.  This is a security bug, although it likely has
only a minor impact.

Cc: stable@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
include/linux/sock_diag.h
net/core/sock_diag.c
net/packet/diag.c