aboutsummaryrefslogtreecommitdiffstats
path: root/security/smack/smack_access.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2015-08-11 11:18:53 +1000
committerJames Morris <james.l.morris@oracle.com>2015-08-11 11:18:53 +1000
commit5ab16579020edb79e215b401399f88c7e07fdaf9 (patch)
tree5fdb2e49d543af7de6b129d6c87abb1967000a6b /security/smack/smack_access.c
parentMerge tag 'asn1-fixes-20150805' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs into next (diff)
parentKernel threads excluded from smack checks (diff)
downloadlinux-dev-5ab16579020edb79e215b401399f88c7e07fdaf9.tar.xz
linux-dev-5ab16579020edb79e215b401399f88c7e07fdaf9.zip
Merge branch 'smack-for-4.3' of https://github.com/cschaufler/smack-next into next
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r--security/smack/smack_access.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index 00f6b38bffbd..bc1053fb5d1d 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -639,6 +639,12 @@ int smack_privileged(int cap)
struct smack_known *skp = smk_of_current();
struct smack_onlycap *sop;
+ /*
+ * All kernel tasks are privileged
+ */
+ if (unlikely(current->flags & PF_KTHREAD))
+ return 1;
+
if (!capable(cap))
return 0;