Message ID | 20190228221933.2551-36-casey@schaufler-ca.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-security-module-owner@kernel.org> 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 9DD211805 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9001A2F53D for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DFF22FC8D; Thu, 28 Feb 2019 22:20:40 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 50E0C2FC94 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730965AbfB1WUj (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Thu, 28 Feb 2019 17:20:39 -0500 Received: from sonic315-15.consmr.mail.gq1.yahoo.com ([98.137.65.39]:46669 "EHLO sonic315-15.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbfB1WUH (ORCPT <rfc822;linux-security-module@vger.kernel.org>); Thu, 28 Feb 2019 17:20:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s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idg5jZMEjG.j_Fo_XzRA7twgXujJLfGJu.vMZISD3T6lSlN_gWEbNyB hxEp4H5X3lFSsLI7qGdA0TQ3V4oD.9cHAdJsEtQByaxHLZ9Zf_nx7q7wYmHywJwT9AaZ.cMOEbKk 1arPMDCRTYmZK41GcMUSviVessEJUrFCoW_onWHy4ysXu_cu8KNf67jRwcOmKodgO7GKz5gIiVY9 xxf6xj5k7LTUQc6yaMxZN9FnWpZnguctPXjwbObfT0lqXgZdilHBFjizUjkD5V2Dc.EETG.grN2Q Fd0nTh5uHlAuNE_CoxlsOeFzDhHLxdHGUgeNBGqYihVDj1D73yUe6JwXfzWCPe4LgoXk7TQOD_tk EmdqHFjzR57enfSXXfgQWkt24iBf0Zyf.K0S7yrVV4EtBAI1xXC8VTiai_n8qJKneYX5swxZ1HAw LjjciG3CuFPTGqosPCAWgOUNOVoSG6Qf3xrwXcxVzN_VBm54P6S0b6x2RpNVMAIsFj1XC5YT9cag Zg9sBI6iQuQMbICp.0G.0SiMCRUo9fSxY6IfZuyt9fpld2vKX Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Feb 2019 22:20:06 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp409.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e8fded081226753664bb344863181a7a; Thu, 28 Feb 2019 22:20:04 +0000 (UTC) From: Casey Schaufler <casey@schaufler-ca.com> To: jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com Subject: [PATCH 35/97] NET: Remove scaffolding on new secmarks Date: Thu, 28 Feb 2019 14:18:31 -0800 Message-Id: <20190228221933.2551-36-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190228221933.2551-1-casey@schaufler-ca.com> References: <20190228221933.2551-1-casey@schaufler-ca.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: <linux-security-module.vger.kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
LSM: Complete module stacking
|
expand
|
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index a03de2ab833a..9f5040140fe0 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c @@ -568,11 +568,17 @@ static int nft_secmark_compute_secid(struct nft_secmark *priv) u32 tmp_secid = 0; int err; + lsm_export_init(&le); err = security_secctx_to_secid(priv->ctx, strlen(priv->ctx), &le); if (err) return err; - lsm_export_secid(&le, &tmp_secid); + /* Use the "best" secid */ + if (le.selinux) + tmp_secid = le.selinux; + else + tmp_secid = le.smack; + if (!tmp_secid) return -ENOENT;
Replace the lsm_export scaffolding in nft_meta. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> --- net/netfilter/nft_meta.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)