From patchwork Mon Jul 31 23:51:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9873389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 214C9603B4 for ; Mon, 31 Jul 2017 23:54:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B53F28567 for ; Mon, 31 Jul 2017 23:54:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F4036285F2; Mon, 31 Jul 2017 23:54:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 783B328599 for ; Mon, 31 Jul 2017 23:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbdGaXxe (ORCPT ); Mon, 31 Jul 2017 19:53:34 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:37192 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751806AbdGaXvx (ORCPT ); Mon, 31 Jul 2017 19:51:53 -0400 Received: by mail-pg0-f51.google.com with SMTP id y129so459542pgy.4 for ; Mon, 31 Jul 2017 16:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HvGN6tHKHAS902MZcJ+XPV969VMjd/HF4oS0fNKmnj4=; b=LfbLNkTAJ7S8ATFbB7F0/vs2Am0XgAVdxVS7FmL0tBhjYFAvpeyNjOPkY7ncuiJlRw UBIS7rYqFdnqR6ysRhLlqdnhSISX+GDTUg90KFLXwD7d5RrSPH/fxAEsULG5dq0wmT8Q 1FhlEWfTf3f2x4ntg73NGxBh1gGdweE1JQyP8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HvGN6tHKHAS902MZcJ+XPV969VMjd/HF4oS0fNKmnj4=; b=Y2SY2BMfMixJMDa2SDNiq/tfwA0VfN94XDlgKkahQwAzTcXD1wOPtgJCmCftwaydGd DxBzzxNSeM5Vd737Yjhc96671N/seOVZl8yf/8Rkcw/qMJdVHPdKUdrAFdXd+Fjl9cME /Dzs2MQFAx+nfO0Kvu5Kt37YqwE8WIBJnJqn+mzbTvPLp2UlTF22mlw7l1BcoEMd9o7+ eoWa6JtxrGWz1fx8JhtorW+9u2ODR5v6NzxKwIRZDHVUVtWLlAfZ3HrS3KollBaIav7j //uzrGh1p5nzLQR0BQKpD4om03QD44cakh+zqi0oBfhxM1AxXpKRkojL2ssXmtBBq8wl fBxg== X-Gm-Message-State: AIVw111WgCxgtyXkvj0YYZv7LgelIVjTkP4yAg63dSnCkeBKja+RGAL2 jK4xSVk2zjr0EWFL X-Received: by 10.99.174.78 with SMTP id e14mr13776611pgp.75.1501545113235; Mon, 31 Jul 2017 16:51:53 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id n11sm20805546pfg.92.2017.07.31.16.51.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 16:51:47 -0700 (PDT) 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 v4 12/15] smack: Remove redundant pdeath_signal clearing Date: Mon, 31 Jul 2017 16:51:30 -0700 Message-Id: <1501545093-56634-13-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501545093-56634-1-git-send-email-keescook@chromium.org> References: <1501545093-56634-1-git-send-email-keescook@chromium.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Serge Hallyn Reviewed-by: James Morris Reviewed-by: Casey Schaufler --- 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),