]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: fix residual uses of current_security() for the SELinux blob
authorStephen Smalley <sds@tycho.nsa.gov>
Wed, 4 Sep 2019 14:32:48 +0000 (10:32 -0400)
committerPaul Moore <paul@paul-moore.com>
Wed, 4 Sep 2019 22:41:12 +0000 (18:41 -0400)
commit5cd14bdadbdbff57b1d288f90d87ef32cfdf62ae
tree7683ec34dd5af93084fe9ecf1effaf0ab73f67bd
parente476393d25eb136e4348ea40bd03b6b89c4a8d3b
selinux: fix residual uses of current_security() for the SELinux blob

We need to use selinux_cred() to fetch the SELinux cred blob instead
of directly using current->security or current_security().  There
were a couple of lingering uses of current_security() in the SELinux code
that were apparently missed during the earlier conversions. IIUC, this
would only manifest as a bug if multiple security modules including
SELinux are enabled and SELinux is not first in the lsm order. After
this change, there appear to be no other users of current_security()
in-tree; perhaps we should remove it altogether.

Fixes: f0bc4698e687 ("Infrastructure management of the cred security blob")
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c
security/selinux/include/objsec.h