]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: clarify task subjective and objective credentials
authorPaul Moore <paul@paul-moore.com>
Thu, 18 Feb 2021 20:13:40 +0000 (15:13 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 22 Mar 2021 19:24:01 +0000 (15:24 -0400)
commit9d2c15ae613aff4d3782124cabccf5b62cbd70a2
treeade0ae5367df7c4b86ab11db169f12f14d641d91
parent12a5eab16498efbd6d3a294c58a937e0fb91fe98
selinux: clarify task subjective and objective credentials

SELinux has a function, task_sid(), which returns the task's
objective credentials, but unfortunately is used in a few places
where the subjective task credentials should be used.  Most notably
in the new security_task_getsecid_subj() LSM hook.

This patch fixes this and attempts to make things more obvious by
introducing a new function, task_sid_subj(), and renaming the
existing task_sid() function to task_sid_obj().

This patch also adds an interesting function in task_sid_binder().
The task_sid_binder() function has a comment which hopefully
describes it's reason for being, but it basically boils down to the
simple fact that we can't safely access another task's subjective
credentials so in the case of binder we need to stick with the
objective credentials regardless.

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c