From patchwork Tue Jul 18 22:25:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9849955 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 66749602BD for ; Tue, 18 Jul 2017 22:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5030428433 for ; Tue, 18 Jul 2017 22:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 450FF285B7; Tue, 18 Jul 2017 22:27:15 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 CFE0F28433 for ; Tue, 18 Jul 2017 22:27:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752682AbdGRW1C (ORCPT ); Tue, 18 Jul 2017 18:27:02 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:33618 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbdGRWZy (ORCPT ); Tue, 18 Jul 2017 18:25:54 -0400 Received: by mail-pg0-f52.google.com with SMTP id k14so19996150pgr.0 for ; Tue, 18 Jul 2017 15:25:54 -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=m+jLQy28VRd7RQJccBWfMf0qW1eg8BH3OAkMuAn4lfs=; b=b3IeWgnC5uD1bxnx8rRqXIIP1lfQyFz7D6fuepHM+1vKJdqXAdCxYBB/+niaxnZcDX EZG/ZrfVs3ZNW/NKsmG0ffHWGGIx2q8hvshDqPbYek9iivPnn1bD6uQ394Fn1zKLakRt j2BJnpxRsSI5MYDC+qjp9MaFTTt+AeicTtWY4= 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=m+jLQy28VRd7RQJccBWfMf0qW1eg8BH3OAkMuAn4lfs=; b=a0pQ4m44ccRyga2+wxe9d94gkQLSNVKJexSKLMd+SUefyobRZm9vctuL5Uachvboeb 7QO3GHAYttL3UCVuzBzYx8CKYaSof5Frd5RhZmceIjH29F7sJyOqowk6EJXBm/Ee1qOR aLm4DryCWATwU24hF9yWovIeEoqvFtLEeyRySNQzQl6os6RCkfAYwP/Ca95DQUF9Kta1 nlN8vpkzsyluR60YP+S+hfxNeLciRrYETlT8SLs8goBxDMAI1I5UFdL6PKGBG5idGcuL v6Jp0mXskcXoLqsQ3s/yoBqvUb94HuOjNncocM9ojz4e2OG6Nb8W33NdEr73oG2qAf/H nEDw== X-Gm-Message-State: AIVw112h7QTGN4ZiQE7ttwuRW/CaSNBduamBRbe/99CV7CH0RuaWOHHV C9laEgTVLjVRIsEb X-Received: by 10.84.210.205 with SMTP id a71mr3928066pli.201.1500416753969; Tue, 18 Jul 2017 15:25: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 t70sm5985994pfk.111.2017.07.18.15.25.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 15:25:52 -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 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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 --- 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),