Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbdGRW11 (ORCPT ); Tue, 18 Jul 2017 18:27:27 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:36533 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675AbdGRWZy (ORCPT ); Tue, 18 Jul 2017 18:25:54 -0400 From: Kees Cook To: Andrew Morton Cc: Kees Cook , Casey Schaufler , David Howells , "Eric W. Biederman" , John Johansen , "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Tetsuo Handa , James Morris , Andy Lutomirski , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 12/15] smack: Remove redundant pdeath_signal clearing Date: Tue, 18 Jul 2017 15:25:33 -0700 Message-Id: <1500416736-49829-13-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500416736-49829-1-git-send-email-keescook@chromium.org> References: <1500416736-49829-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 47 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 Signed-off-by: Kees Cook --- 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), -- 2.7.4