Message ID | 20190409213946.1667-29-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 3AE6A13B5 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E8A5285C6 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 235912887B; Tue, 9 Apr 2019 21:41:17 +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 D2A7C285C6 for <patchwork-selinux@patchwork.kernel.org>; Tue, 9 Apr 2019 21:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbfDIVlP (ORCPT <rfc822;patchwork-selinux@patchwork.kernel.org>); Tue, 9 Apr 2019 17:41:15 -0400 Received: from sonic301-38.consmr.mail.ne1.yahoo.com ([66.163.184.207]:40449 "EHLO sonic301-38.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfDIVlE (ORCPT <rfc822;selinux@vger.kernel.org>); Tue, 9 Apr 2019 17:41:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2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hh6L4do2IFxzxMLhus.CZ4ktKyY5_IpVX8ukm4avLRJhbNgkZHVDWD1en i3Od8j8IsX7vyt.xyxMiAytGpU8n3MDweB7Hb8qseW6vqHlfHHDE4KGfeXh7YH8maUz1rrcdSJag KqQcdJ9uE4MLwiWueyD71e.rqCd9wtO_Ha1c53WXqqDPtrLANhTa2l53dETU9QRC7V2Hq4miEgjQ uDzBwqpuActE81JqRitp3LW3tpGimr1whtYp6MEk7Yj6p37.Qet1v7Z9tzcrFNEPe3v5ReDV2QHL Y2OfG7Su1m7ZG8HISdmrfjQROOIRtbx6VG5uFyA0z.1KFc4zY_7HWRCP052R23uPfFwDUxML.0Ok lr6UROB4bxol8FWoGDowOvAXW9He8NthtXP5xzhVD2qCQo9O3em2EE3gKMoiXoSDcP2_yHTsG34g zXvpihlHw4SIPmclLc46GMUpGCSAaXoDrRr9ROmWPBIbkpg5j03WzirFvIq9Bt2BaRxcEC_DehP2 iXAFvoWtKZrAwadh_nPKjWiym6hPu3pyambtCfRHuONCbpwmiHK7R4_22acnVcA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Apr 2019 21:41:03 +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:36 +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 28/59] NET: Remove scaffolding on secmarks Date: Tue, 9 Apr 2019 14:39:15 -0700 Message-Id: <20190409213946.1667-29-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/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c index 2def8d8898e6..9a2a97c200a2 100644 --- a/net/netfilter/xt_SECMARK.c +++ b/net/netfilter/xt_SECMARK.c @@ -55,6 +55,7 @@ static int checkentry_lsm(struct xt_secmark_target_info *info) info->secctx[SECMARK_SECCTX_MAX - 1] = '\0'; info->secid = 0; + lsm_export_init(&le); err = security_secctx_to_secid(info->secctx, strlen(info->secctx), &le); if (err) { if (err == -EINVAL) @@ -63,7 +64,12 @@ static int checkentry_lsm(struct xt_secmark_target_info *info) return err; } - lsm_export_secid(&le, &info->secid); + /* Smack is cheating, using SECMARK_MODE_SEL */ + if (le.selinux) + info->secid = le.selinux; + else + info->secid = le.smack; + if (!info->secid) { pr_info_ratelimited("unable to map security context \'%s\'\n", info->secctx);
Replace the lsm_export scaffolding in xt_SECMARK.c This raises an issue, in that Smack users have been using SECMARK_MODE_SEL, which is suppoed to be exclusively for SELinux. This is worked around in the code, but not fully addressed. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> --- net/netfilter/xt_SECMARK.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)