summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-04-24 13:45:04 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-24 13:45:04 -0400
commit29ea86caa27c7ad8bf2c2762150fdbd6fa36cb4f (patch)
treea7c154e7628d8aed372eccc76a1d6f86f461da6e
parentce945bb935ddd4a72cc49c11e755dea2de7a81c9 (diff)
parentcac625df778c68b7bcb761ed51d42b8db9e2fea8 (diff)
downloadlinux-crypto-29ea86caa27c7ad8bf2c2762150fdbd6fa36cb4f.tar.gz
linux-crypto-29ea86caa27c7ad8bf2c2762150fdbd6fa36cb4f.zip
Merge branch 'netlink-caps'
Eric W. Biederman says: ==================== netlink: Preventing abuse when passing file descriptors. Andy Lutomirski when looking at the networking stack noticed that it is possible to trick privilged processes into calling write on a netlink socket and send netlink messages they did not intend. In particular from time to time there are suid applications that will write to stdout or stderr without checking exactly what kind of file descriptors those are and can be tricked into acting as a limited form of suid cat. In other conversations the magic string CVE-2014-0181 has been used to talk about this issue. This patchset cleans things up a bit, adds some clean abstractions that when used prevent this kind of problem and then finally changes all of the handlers of netlink messages that I could find that call capable to use netlink_ns_capable or an appropriate wrapper. The abstraction netlink_ns_capable verifies that the original creator of the netlink socket a message is sent from had the necessary capabilities as well as verifying that the current sender of a netlink packet has the necessary capabilities. The idea is to prevent file descriptor passing of any form from resulting in a file descriptor that can do more than it can for the creator of the file descriptor. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--crypto/crypto_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 1512e41c..43665d0d 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -466,7 +466,7 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
type -= CRYPTO_MSG_BASE;
link = &crypto_dispatch[type];
- if (!capable(CAP_NET_ADMIN))
+ if (!netlink_capable(skb, CAP_NET_ADMIN))
return -EPERM;
if ((type == (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE) &&