summaryrefslogtreecommitdiff
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-07-19 14:59:07 -0700
committerOlof Johansson <olof@lixom.net>2014-07-19 14:59:07 -0700
commitfcbaa19cb691a882b52164d375243638a9f0c7d0 (patch)
treed22e795511b00930b9784bd8ca2f6477f24652f8 /crypto/crypto_user.c
parent6e3b70d7efc613e9444d3931f89c8586880a9181 (diff)
parent9b40a3dd3d4e3ff9904e049f6794c972b603272f (diff)
downloadlinux-crypto-fcbaa19cb691a882b52164d375243638a9f0c7d0.tar.gz
linux-crypto-fcbaa19cb691a882b52164d375243638a9f0c7d0.zip
Merge tag 'v3.16-rc5' into next/fixes-non-critical
Linux 3.16-rc5
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r--crypto/crypto_user.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 43665d0d..e2a34fee 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -265,6 +265,9 @@ static int crypto_update_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL];
LIST_HEAD(list);
+ if (!netlink_capable(skb, CAP_NET_ADMIN))
+ return -EPERM;
+
if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name))
return -EINVAL;
@@ -295,6 +298,9 @@ static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct crypto_alg *alg;
struct crypto_user_alg *p = nlmsg_data(nlh);
+ if (!netlink_capable(skb, CAP_NET_ADMIN))
+ return -EPERM;
+
if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name))
return -EINVAL;
@@ -379,6 +385,9 @@ static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct crypto_user_alg *p = nlmsg_data(nlh);
struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL];
+ if (!netlink_capable(skb, CAP_NET_ADMIN))
+ return -EPERM;
+
if (!null_terminated(p->cru_name) || !null_terminated(p->cru_driver_name))
return -EINVAL;
@@ -466,9 +475,6 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
type -= CRYPTO_MSG_BASE;
link = &crypto_dispatch[type];
- if (!netlink_capable(skb, CAP_NET_ADMIN))
- return -EPERM;
-
if ((type == (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE) &&
(nlh->nlmsg_flags & NLM_F_DUMP))) {
struct crypto_alg *alg;