From patchwork Tue Apr 9 21:39:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10892695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C4FF1805 for ; Tue, 9 Apr 2019 21:41:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F1528857 for ; Tue, 9 Apr 2019 21:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E76C42887B; Tue, 9 Apr 2019 21:41:53 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 A07A028857 for ; Tue, 9 Apr 2019 21:41:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbfDIVlx (ORCPT ); Tue, 9 Apr 2019 17:41:53 -0400 Received: from sonic304-28.consmr.mail.ne1.yahoo.com ([66.163.191.154]:35709 "EHLO sonic304-28.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbfDIVlw (ORCPT ); Tue, 9 Apr 2019 17:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1554846093; bh=XFEQORQN/Rrt9xNIMHTY8NF01S7CWObpcTiWCO3b0pw=; h=From:To:Cc:Subject:Date:In-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rhUYf2JJ9hi6PoO08mEz7925lEVlOfmIjD5cQZtRAyBrT24pBI P7QW9LT5Ssza0OeoOrfm4ahr3bUYBFh9FSut5wJ5ak4tvd67pmCr6ZyS02KeJMJkLc0DPUYgJpQ_ j.hX9zkjDtKFbj9Z9RtPjbSoQtV37vniDHcJVoYAlYiaG38_9J1m0.SV6MS0t7gVw1hv4o1u8YkQ LH6Uyv89.m8UMZ5Z6hiEtfS8_T7A5vz6WaR2LerzFxESv8mlx20WXiwpY3EI5kWq0qHIacPutvQY .MrYjS.PMDQfpeJJ5EdqKrCoGrW_v5W8SeGG67XOE.OvAwVFQOonx1hkggU5fynDEW55VuM_zCYv pZuCR9xKrXOkfVwBBZobIicmIPHQ9xCrO6VPxvy7hLLa1Kt5cTlL2xpN2_n27sYcSNBSg_ehEFSK OlBV50dsDS9oQ4dngvyz8lvgeQCZaHjyx26RwoZrgTLp.UdtqitmqyrlzSkznUw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:41:33 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp422.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4c017142cf03fa35170466cff726262b; Tue, 09 Apr 2019 21:40:45 +0000 (UTC) From: Casey Schaufler To: casey.schaufler@intel.com, jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: casey@schaufler-ca.com Subject: [PATCH 34/59] Smack: Restore the release_secctx hook Date: Tue, 9 Apr 2019 14:39:21 -0700 Message-Id: <20190409213946.1667-35-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190409213946.1667-1-casey@schaufler-ca.com> References: <20190409213946.1667-1-casey@schaufler-ca.com> Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The secid_to_secctx() hook has to be balanced with a release_secctx hook for stacking. This hook does nothing. Signed-off-by: Casey Schaufler --- security/smack/smack_lsm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 38ea48d22547..a837af153ed9 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -4470,10 +4470,11 @@ static int smack_secctx_to_secid(const char *secdata, u32 seclen, } /* - * There used to be a smack_release_secctx hook - * that did nothing back when hooks were in a vector. - * Now that there's a list such a hook adds cost. + * There smack_release_secctx hook does nothing */ +static void smack_release_secctx(char *secdata, u32 seclen) +{ +} static int smack_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) { @@ -4713,6 +4714,7 @@ static struct security_hook_list smack_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(ismaclabel, smack_ismaclabel), LSM_HOOK_INIT(secid_to_secctx, smack_secid_to_secctx), LSM_HOOK_INIT(secctx_to_secid, smack_secctx_to_secid), + LSM_HOOK_INIT(release_secctx, smack_release_secctx), LSM_HOOK_INIT(inode_notifysecctx, smack_inode_notifysecctx), LSM_HOOK_INIT(inode_setsecctx, smack_inode_setsecctx), LSM_HOOK_INIT(inode_getsecctx, smack_inode_getsecctx),