Skip to content

Commit

Permalink
SELinux: Remove cred security blob poisoning
Browse files Browse the repository at this point in the history
The SELinux specific credential poisioning only makes sense
if SELinux is managing the credentials. As the intent of this
patch set is to move the blob management out of the modules
and into the infrastructure, the SELinux specific code has
to go. The poisioning could be introduced into the infrastructure
at some later date.

Signed-off-by: Casey Schaufler <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
cschaufler authored and kees committed Jan 8, 2019
1 parent 0c6cfa6 commit 98c8865
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
13 changes: 0 additions & 13 deletions kernel/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,19 +760,6 @@ bool creds_are_invalid(const struct cred *cred)
{
if (cred->magic != CRED_MAGIC)
return true;
#ifdef CONFIG_SECURITY_SELINUX
/*
* cred->security == NULL if security_cred_alloc_blank() or
* security_prepare_creds() returned an error.
*/
if (selinux_is_enabled() && cred->security) {
if ((unsigned long) cred->security < PAGE_SIZE)
return true;
if ((*(u32 *)cred->security & 0xffffff00) ==
(POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8))
return true;
}
#endif
return false;
}
EXPORT_SYMBOL(creds_are_invalid);
Expand Down
6 changes: 0 additions & 6 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3708,12 +3708,6 @@ static void selinux_cred_free(struct cred *cred)
{
struct task_security_struct *tsec = selinux_cred(cred);

/*
* cred->security == NULL if security_cred_alloc_blank() or
* security_prepare_creds() returned an error.
*/
BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE);
cred->security = (void *) 0x7UL;
kfree(tsec);
}

Expand Down

0 comments on commit 98c8865

Please sign in to comment.