]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.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)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 26 Mar 2019 14:54:18 +0000 (09:54 -0500)
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>
(cherry picked from commit 98c88651365767c72ec6dc672072423bc19a39aa)
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
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 a64dacaa91b151eb3a8bf9fa13e5a0e3d9aaf148..f9f7ba0988f8282af62d4963439e5d7538c14f9c 100644 (file)
@@ -3711,12 +3711,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);
 }