mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 17:23:25 -05:00
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 <r.kubiak@samsung.com> Acked-by: Casey Schaufler <casey@schaufler-ca.com>
This commit is contained in:
parent
1eddfe8edb
commit
41a2d57516
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue