diff mbox

[v4,12/15] smack: Remove redundant pdeath_signal clearing

Message ID 1501545093-56634-13-git-send-email-keescook@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Kees Cook July 31, 2017, 11:51 p.m. UTC
This removes the redundant pdeath_signal clearing in Smack: the check in
smack_bprm_committing_creds() matches the check in smack_bprm_set_creds()
(which used to be in the now-removed smack_bprm_securexec() hook) and
since secureexec is now being checked for clearing pdeath_signal, this
is redundant to the common exec code.

Cc: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge@hallyn.com>
---
 security/smack/smack_lsm.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

James Morris Aug. 1, 2017, 12:50 a.m. UTC | #1
On Mon, 31 Jul 2017, Kees Cook wrote:

> This removes the redundant pdeath_signal clearing in Smack: the check in
> smack_bprm_committing_creds() matches the check in smack_bprm_set_creds()
> (which used to be in the now-removed smack_bprm_securexec() hook) and
> since secureexec is now being checked for clearing pdeath_signal, this
> is redundant to the common exec code.
> 
> Cc: Casey Schaufler <casey@schaufler-ca.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Acked-by: Serge Hallyn <serge@hallyn.com>
> ---
>  security/smack/smack_lsm.c | 15 ---------------
>  1 file changed, 15 deletions(-)


Reviewed-by: James Morris <james.l.morris@oracle.com>
Casey Schaufler Aug. 1, 2017, 3:24 p.m. UTC | #2
On 7/31/2017 4:51 PM, Kees Cook wrote:
> This removes the redundant pdeath_signal clearing in Smack: the check in
> smack_bprm_committing_creds() matches the check in smack_bprm_set_creds()
> (which used to be in the now-removed smack_bprm_securexec() hook) and
> since secureexec is now being checked for clearing pdeath_signal, this
> is redundant to the common exec code.
>
> Cc: Casey Schaufler <casey@schaufler-ca.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Acked-by: Serge Hallyn <serge@hallyn.com>

Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>

> ---
>  security/smack/smack_lsm.c | 15 ---------------
>  1 file changed, 15 deletions(-)
>
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 4f1967be3d20..4e33c650b224 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -957,20 +957,6 @@ static int smack_bprm_set_creds(struct linux_binprm *bprm)
>  	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;
> -
> -	if (bsp->smk_task != bsp->smk_forked)
> -		current->pdeath_signal = 0;
> -}
> -
>  /*
>   * Inode hooks
>   */
> @@ -4633,7 +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(inode_alloc_security, smack_inode_alloc_security),
>  	LSM_HOOK_INIT(inode_free_security, smack_inode_free_security),

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 4f1967be3d20..4e33c650b224 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -957,20 +957,6 @@  static int smack_bprm_set_creds(struct linux_binprm *bprm)
 	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;
-
-	if (bsp->smk_task != bsp->smk_forked)
-		current->pdeath_signal = 0;
-}
-
 /*
  * Inode hooks
  */
@@ -4633,7 +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(inode_alloc_security, smack_inode_alloc_security),
 	LSM_HOOK_INIT(inode_free_security, smack_inode_free_security),