Message ID | 20190409213946.1667-30-casey@schaufler-ca.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <selinux-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 6833A1A2B for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58F7428952 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D3AE2897E; Tue, 9 Apr 2019 21:40:46 +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 F04A828952 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfDIVkm (ORCPT <rfc822;patchwork-selinux@patchwork.kernel.org>); Tue, 9 Apr 2019 17:40:42 -0400 Received: from sonic317-39.consmr.mail.ne1.yahoo.com ([66.163.184.50]:33114 "EHLO sonic317-39.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbfDIVkk (ORCPT <rfc822;selinux@vger.kernel.org>); Tue, 9 Apr 2019 17:40:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=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62iyqSlmENqqSIuLrXGJwZKMipBRYYWrK03zd8t OlCbAETOYrvzhQ2ZG5Jil_3EdMQrOZWIVYZ0BB7vt1GIIdbUI_kC5hfAX2j_eWqzHR7n2HXjMOzz ddSMJ1UMwjlktepwWnapQ9UwVv_OGPNmFlxM2xuhXP6Or3gUcWrmbr0GYLsbBoJHaGxXuKWuMybm PC1VUyyspg55lD1rf2dhB2gCwZdHrN4.yskDsE4Mxw1fE7owb8rhmRvroQojtli0Q252oz0EepHo NZW5sGIE_SUq6R_CRcfQM7yEscq4IsRBRxhMx6W4Bd2vJDThrorqqHrDYems3CY7Z7o_9M7t8XyD HYE_jMrb04297ehVpoEC3djNV3vlBG7XzJekgi4YwDR6TN0JtF1x.Ze1mLOYpugbz3lAmXJpPwJd VULRFokAj6mMgNEDnWgoeZXXK24zepF5bjAMMefWCscUQh0.DbrQPk80tWx18tq2r429k6a_tP4K MZ7FQYHFjSlwR8HlTZt1cGPOt8WxO9TPtk.ARRhy2VTG1GWd7dK4aN08ywGTKPw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:40:39 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp407.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0f9fc43d6127678694d9e39aed29be56; Tue, 09 Apr 2019 21:40:37 +0000 (UTC) From: Casey Schaufler <casey@schaufler-ca.com> 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 29/59] NET: Remove scaffolding on new secmarks Date: Tue, 9 Apr 2019 14:39:16 -0700 Message-Id: <20190409213946.1667-30-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: <selinux.vger.kernel.org> X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
LSM: Module stacking for AppArmor
|
expand
|
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index 598bea8e4799..a1d3dab5bc25 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c @@ -580,11 +580,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(-)