Skip to content

Commit 41a2d57

Browse files
Instigat0rcschaufler
authored andcommitted
Kernel threads excluded from smack checks
Adds an ignore case for kernel tasks, so that they can access all resources. Since kernel worker threads are spawned with floor label, they are severely restricted by Smack policy. It is not an issue without onlycap, as these processes also run with root, so CAP_MAC_OVERRIDE kicks in. But with onlycap turned on, there is no way to change the label for these processes. Signed-off-by: Roman Kubiak <[email protected]> Acked-by: Casey Schaufler <[email protected]>
1 parent 1eddfe8 commit 41a2d57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

security/smack/smack_access.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,12 @@ int smack_privileged(int cap)
639639
struct smack_known *skp = smk_of_current();
640640
struct smack_onlycap *sop;
641641

642+
/*
643+
* All kernel tasks are privileged
644+
*/
645+
if (unlikely(current->flags & PF_KTHREAD))
646+
return 1;
647+
642648
if (!capable(cap))
643649
return 0;
644650

0 commit comments

Comments
 (0)