]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - security/smack/smack_lsm.c
smack: Remove redundant pdeath_signal clearing
[linux.git] / security / smack / smack_lsm.c
index 463af86812c7ac295e5d5c02b3c20a79c5f8242a..319add31b4a4ee7b5464d2a15782289ecb110ce7 100644 (file)
@@ -917,7 +917,7 @@ static int smack_bprm_set_creds(struct linux_binprm *bprm)
        struct superblock_smack *sbsp;
        int rc;
 
-       if (bprm->cred_prepared)
+       if (bprm->called_set_creds)
                return 0;
 
        isp = inode->i_security;
@@ -950,35 +950,9 @@ static int smack_bprm_set_creds(struct linux_binprm *bprm)
        bsp->smk_task = isp->smk_task;
        bprm->per_clear |= PER_CLEAR_ON_SETID;
 
-       return 0;
-}
-
-/**
- * smack_bprm_committing_creds - Prepare to install the new credentials
- * from bprm.
- *
- * @bprm: binprm for exec
- */
-static void smack_bprm_committing_creds(struct linux_binprm *bprm)
-{
-       struct task_smack *bsp = bprm->cred->security;
-
+       /* Decide if this is a secure exec. */
        if (bsp->smk_task != bsp->smk_forked)
-               current->pdeath_signal = 0;
-}
-
-/**
- * smack_bprm_secureexec - Return the decision to use secureexec.
- * @bprm: binprm for exec
- *
- * Returns 0 on success.
- */
-static int smack_bprm_secureexec(struct linux_binprm *bprm)
-{
-       struct task_smack *tsp = current_security();
-
-       if (tsp->smk_task != tsp->smk_forked)
-               return 1;
+               bprm->secureexec = 1;
 
        return 0;
 }
@@ -4645,8 +4619,6 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = {
        LSM_HOOK_INIT(sb_parse_opts_str, smack_parse_opts_str),
 
        LSM_HOOK_INIT(bprm_set_creds, smack_bprm_set_creds),
-       LSM_HOOK_INIT(bprm_committing_creds, smack_bprm_committing_creds),
-       LSM_HOOK_INIT(bprm_secureexec, smack_bprm_secureexec),
 
        LSM_HOOK_INIT(inode_alloc_security, smack_inode_alloc_security),
        LSM_HOOK_INIT(inode_free_security, smack_inode_free_security),