aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-08-05 15:44:22 -0400
committerPaul Moore <pmoore@redhat.com>2014-08-05 15:44:22 -0400
commitaa9e0de81b5b257f6dae48efe2ed5f255f066497 (patch)
tree9b0b791d5912368006115427e74105cfe26750bd /security
parent4fbe63d1c773cceef3fe1f6ed0c9c268f4f24760 (diff)
parent19583ca584d6f574384e17fe7613dfaeadcdc4a6 (diff)
Merge tag 'v3.16' into next
Linux 3.16
Diffstat (limited to 'security')
-rw-r--r--security/capability.c2
-rw-r--r--security/device_cgroup.c33
-rw-r--r--security/integrity/evm/Kconfig42
-rw-r--r--security/integrity/evm/evm.h5
-rw-r--r--security/integrity/evm/evm_crypto.c2
-rw-r--r--security/integrity/evm/evm_main.c29
-rw-r--r--security/integrity/ima/ima_api.c10
-rw-r--r--security/integrity/ima/ima_appraise.c10
-rw-r--r--security/integrity/ima/ima_crypto.c32
-rw-r--r--security/integrity/ima/ima_main.c27
-rw-r--r--security/integrity/ima/ima_policy.c6
-rw-r--r--security/integrity/integrity.h1
-rw-r--r--security/keys/internal.h11
-rw-r--r--security/keys/key.c6
-rw-r--r--security/keys/keyctl.c44
-rw-r--r--security/keys/keyring.c8
-rw-r--r--security/keys/permission.c4
-rw-r--r--security/keys/persistent.c4
-rw-r--r--security/keys/proc.c2
-rw-r--r--security/keys/sysctl.c2
-rw-r--r--security/security.c2
-rw-r--r--security/selinux/hooks.c2
-rw-r--r--security/selinux/include/classmap.h2
-rw-r--r--security/smack/smack.h16
-rw-r--r--security/smack/smack_access.c38
-rw-r--r--security/smack/smack_lsm.c249
-rw-r--r--security/smack/smackfs.c76
27 files changed, 490 insertions, 175 deletions
diff --git a/security/capability.c b/security/capability.c
index ad0d4de69944..e76373de3129 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -879,7 +879,7 @@ static void cap_key_free(struct key *key)
879} 879}
880 880
881static int cap_key_permission(key_ref_t key_ref, const struct cred *cred, 881static int cap_key_permission(key_ref_t key_ref, const struct cred *cred,
882 key_perm_t perm) 882 unsigned perm)
883{ 883{
884 return 0; 884 return 0;
885} 885}
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 9134dbf70d3e..d9d69e6930ed 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -182,7 +182,7 @@ static inline bool is_devcg_online(const struct dev_cgroup *devcg)
182static int devcgroup_online(struct cgroup_subsys_state *css) 182static int devcgroup_online(struct cgroup_subsys_state *css)
183{ 183{
184 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); 184 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
185 struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css_parent(css)); 185 struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css->parent);
186 int ret = 0; 186 int ret = 0;
187 187
188 mutex_lock(&devcgroup_mutex); 188 mutex_lock(&devcgroup_mutex);
@@ -455,7 +455,7 @@ static bool verify_new_ex(struct dev_cgroup *dev_cgroup,
455static int parent_has_perm(struct dev_cgroup *childcg, 455static int parent_has_perm(struct dev_cgroup *childcg,
456 struct dev_exception_item *ex) 456 struct dev_exception_item *ex)
457{ 457{
458 struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css)); 458 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
459 459
460 if (!parent) 460 if (!parent)
461 return 1; 461 return 1;
@@ -476,7 +476,7 @@ static int parent_has_perm(struct dev_cgroup *childcg,
476static bool parent_allows_removal(struct dev_cgroup *childcg, 476static bool parent_allows_removal(struct dev_cgroup *childcg,
477 struct dev_exception_item *ex) 477 struct dev_exception_item *ex)
478{ 478{
479 struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css)); 479 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
480 480
481 if (!parent) 481 if (!parent)
482 return true; 482 return true;
@@ -587,13 +587,6 @@ static int propagate_exception(struct dev_cgroup *devcg_root,
587 return rc; 587 return rc;
588} 588}
589 589
590static inline bool has_children(struct dev_cgroup *devcgroup)
591{
592 struct cgroup *cgrp = devcgroup->css.cgroup;
593
594 return !list_empty(&cgrp->children);
595}
596
597/* 590/*
598 * Modify the exception list using allow/deny rules. 591 * Modify the exception list using allow/deny rules.
599 * CAP_SYS_ADMIN is needed for this. It's at least separate from CAP_MKNOD 592 * CAP_SYS_ADMIN is needed for this. It's at least separate from CAP_MKNOD
@@ -614,7 +607,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
614 char temp[12]; /* 11 + 1 characters needed for a u32 */ 607 char temp[12]; /* 11 + 1 characters needed for a u32 */
615 int count, rc = 0; 608 int count, rc = 0;
616 struct dev_exception_item ex; 609 struct dev_exception_item ex;
617 struct dev_cgroup *parent = css_to_devcgroup(css_parent(&devcgroup->css)); 610 struct dev_cgroup *parent = css_to_devcgroup(devcgroup->css.parent);
618 611
619 if (!capable(CAP_SYS_ADMIN)) 612 if (!capable(CAP_SYS_ADMIN))
620 return -EPERM; 613 return -EPERM;
@@ -626,7 +619,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
626 case 'a': 619 case 'a':
627 switch (filetype) { 620 switch (filetype) {
628 case DEVCG_ALLOW: 621 case DEVCG_ALLOW:
629 if (has_children(devcgroup)) 622 if (css_has_online_children(&devcgroup->css))
630 return -EINVAL; 623 return -EINVAL;
631 624
632 if (!may_allow_all(parent)) 625 if (!may_allow_all(parent))
@@ -642,7 +635,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
642 return rc; 635 return rc;
643 break; 636 break;
644 case DEVCG_DENY: 637 case DEVCG_DENY:
645 if (has_children(devcgroup)) 638 if (css_has_online_children(&devcgroup->css))
646 return -EINVAL; 639 return -EINVAL;
647 640
648 dev_exception_clean(devcgroup); 641 dev_exception_clean(devcgroup);
@@ -767,27 +760,27 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
767 return rc; 760 return rc;
768} 761}
769 762
770static int devcgroup_access_write(struct cgroup_subsys_state *css, 763static ssize_t devcgroup_access_write(struct kernfs_open_file *of,
771 struct cftype *cft, char *buffer) 764 char *buf, size_t nbytes, loff_t off)
772{ 765{
773 int retval; 766 int retval;
774 767
775 mutex_lock(&devcgroup_mutex); 768 mutex_lock(&devcgroup_mutex);
776 retval = devcgroup_update_access(css_to_devcgroup(css), 769 retval = devcgroup_update_access(css_to_devcgroup(of_css(of)),
777 cft->private, buffer); 770 of_cft(of)->private, strstrip(buf));
778 mutex_unlock(&devcgroup_mutex); 771 mutex_unlock(&devcgroup_mutex);
779 return retval; 772 return retval ?: nbytes;
780} 773}
781 774
782static struct cftype dev_cgroup_files[] = { 775static struct cftype dev_cgroup_files[] = {
783 { 776 {
784 .name = "allow", 777 .name = "allow",
785 .write_string = devcgroup_access_write, 778 .write = devcgroup_access_write,
786 .private = DEVCG_ALLOW, 779 .private = DEVCG_ALLOW,
787 }, 780 },
788 { 781 {
789 .name = "deny", 782 .name = "deny",
790 .write_string = devcgroup_access_write, 783 .write = devcgroup_access_write,
791 .private = DEVCG_DENY, 784 .private = DEVCG_DENY,
792 }, 785 },
793 { 786 {
diff --git a/security/integrity/evm/Kconfig b/security/integrity/evm/Kconfig
index d35b4915b00d..d606f3d12d6b 100644
--- a/security/integrity/evm/Kconfig
+++ b/security/integrity/evm/Kconfig
@@ -12,15 +12,41 @@ config EVM
12 12
13 If you are unsure how to answer this question, answer N. 13 If you are unsure how to answer this question, answer N.
14