]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
SELinux: Remove cred security blob poisoning
authorCasey Schaufler <casey@schaufler-ca.com>
Sat, 22 Sep 2018 00:17:25 +0000 (17:17 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 8 Jan 2019 21:18:44 +0000 (13:18 -0800)
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 <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/cred.c
security/selinux/hooks.c

index 21f4a97085b4041bcbe9b23568aec7bed935f21f..45d77284aed0a91383e71e53bfadf6dd5017f7e0 100644 (file)
@@ -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);
index beec1de5c2dae263f08a33c2fce800f53036aece..ad227177550b4e3601d78c2aa0663ab5e27b6840 100644 (file)
@@ -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);
 }