aboutsummaryrefslogtreecommitdiffstats
path: root/security/smack/smack_access.c
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2012-06-05 18:28:30 -0400
committerCasey Schaufler <casey@schaufler-ca.com>2012-07-13 18:49:23 -0400
commit1880eff77e7a7cb46c68fae7cfa33f72f0a6e70e (patch)
treefc4b9a2ca7c643a30cbe2260886fdbd969bf2b50 /security/smack/smack_access.c
parenteb982cb4cf6405b97ea1f9e1d10864981f269d46 (diff)
Smack: onlycap limits on CAP_MAC_ADMIN
Smack is integrated with the POSIX capabilities scheme, using the capabilities CAP_MAC_OVERRIDE and CAP_MAC_ADMIN to determine if a process is allowed to ignore Smack checks or change Smack related data respectively. Smack provides an additional restriction that if an onlycap value is set by writing to /smack/onlycap only tasks with that Smack label are allowed to use CAP_MAC_OVERRIDE. This change adds CAP_MAC_ADMIN as a capability that is affected by the onlycap mechanism. Targeted for git://git.gitorious.org/smack-next/kernel.git Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r--security/smack/smack_access.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index 9f3705e92712..db14689a21e0 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -220,14 +220,9 @@ int smk_curacc(char *obj_label, u32 mode, struct smk_audit_info *a)
220 } 220 }
221 221
222 /* 222 /*
223 * Return if a specific label has been designated as the 223 * Allow for priviliged to override policy.
224 * only one that gets privilege and current does not
225 * have that label.
226 */ 224 */
227 if (smack_onlycap != NULL && smack_onlycap != sp) 225 if (rc != 0 && smack_privileged(CAP_MAC_OVERRIDE))
228 goto out_audit;
229
230 if (capable(CAP_MAC_OVERRIDE))
231 rc = 0; 226 rc = 0;
232 227
233out_audit: 228out_audit: