diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-08 20:39:29 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-08 20:39:29 -0500 |
commit | ba00410b8131b23edfb0e09f8b6dd26c8eb621fb (patch) | |
tree | c08504e4d2fa51ac91cef544f336d0169806c49f /security | |
parent | 8ce74dd6057832618957fc2cbd38fa959c3a0a6c (diff) | |
parent | aa583096d9767892983332e7c1a984bd17e3cd39 (diff) |
Merge branch 'iov_iter' into for-next
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/evm/evm_main.c | 9 | ||||
-rw-r--r-- | security/integrity/ima/ima_appraise.c | 2 | ||||
-rw-r--r-- | security/integrity/integrity.h | 1 | ||||
-rw-r--r-- | security/selinux/hooks.c | 7 |
4 files changed, 13 insertions, 6 deletions
diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index 9685af330de5..c5ee1a7c5e8a 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/integrity/evm/evm_main.c | |||
@@ -319,9 +319,12 @@ int evm_inode_setxattr(struct dentry *dentry, const char *xattr_name, | |||
319 | { | 319 | { |
320 | const struct evm_ima_xattr_data *xattr_data = xattr_value; | 320 | const struct evm_ima_xattr_data *xattr_data = xattr_value; |
321 | 321 | ||
322 | if ((strcmp(xattr_name, XATTR_NAME_EVM) == 0) | 322 | if (strcmp(xattr_name, XATTR_NAME_EVM) == 0) { |
323 | && (xattr_data->type == EVM_XATTR_HMAC)) | 323 | if (!xattr_value_len) |
324 | return -EPERM; | 324 | return -EINVAL; |
325 | if (xattr_data->type != EVM_IMA_XATTR_DIGSIG) | ||
326 | return -EPERM; | ||
327 | } | ||
325 | return evm_protect_xattr(dentry, xattr_name, xattr_value, | 328 | return evm_protect_xattr(dentry, xattr_name, xattr_value, |
326 | xattr_value_len); | 329 | xattr_value_len); |
327 | } | 330 | } |
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index c2f203accbd1..fffcdb0b31f0 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c | |||
@@ -378,6 +378,8 @@ int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, | |||
378 | result = ima_protect_xattr(dentry, xattr_name, xattr_value, | 378 | result = ima_protect_xattr(dentry, xattr_name, xattr_value, |
379 | xattr_value_len); | 379 | xattr_value_len); |
380 | if (result == 1) { | 380 | if (result == 1) { |
381 | if (!xattr_value_len || (xvalue->type >= IMA_XATTR_LAST)) | ||
382 | return -EINVAL; | ||
381 | ima_reset_appraise_flags(dentry->d_inode, | 383 | ima_reset_appraise_flags(dentry->d_inode, |
382 | (xvalue->type == EVM_IMA_XATTR_DIGSIG) ? 1 : 0); | 384 | (xvalue->type == EVM_IMA_XATTR_DIGSIG) ? 1 : 0); |
383 | result = 0; | 385 | result = 0; |
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h index c0379d13dbe1..9d1c2ebfe12a 100644 --- a/security/integrity/integrity.h +++ b/security/integrity/integrity.h | |||
@@ -61,6 +61,7 @@ enum evm_ima_xattr_type { | |||
61 | EVM_XATTR_HMAC, | 61 | EVM_XATTR_HMAC, |
62 | EVM_IMA_XATTR_DIGSIG, | 62 | EVM_IMA_XATTR_DIGSIG, |
63 | IMA_XATTR_DIGEST_NG, | 63 | IMA_XATTR_DIGEST_NG, |
64 | IMA_XATTR_LAST | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | struct evm_ima_xattr_data { | 67 | struct evm_ima_xattr_data { |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e66314138b38..c603b20356ad 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -4725,9 +4725,10 @@ static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb) | |||
4725 | err = selinux_nlmsg_lookup(sksec->sclass, nlh->nlmsg_type, &perm); | 4725 | err = selinux_nlmsg_lookup(sksec->sclass, nlh->nlmsg_type, &perm); |
4726 | if (err) { | 4726 | if (err) { |
4727 | if (err == -EINVAL) { | 4727 | if (err == -EINVAL) { |
4728 | WARN_ONCE(1, "selinux_nlmsg_perm: unrecognized netlink message:" | 4728 | printk(KERN_WARNING |
4729 | " protocol=%hu nlmsg_type=%hu sclass=%hu\n", | 4729 | "SELinux: unrecognized netlink message:" |
4730 | sk->sk_protocol, nlh->nlmsg_type, sksec->sclass); | 4730 | " protocol=%hu nlmsg_type=%hu sclass=%hu\n", |
4731 | sk->sk_protocol, nlh->nlmsg_type, sksec->sclass); | ||
4731 | if (!selinux_enforcing || security_get_allow_unknown()) | 4732 | if (!selinux_enforcing || security_get_allow_unknown()) |
4732 | err = 0; | 4733 | err = 0; |
4733 | } | 4734 | } |