Message ID | 20190228221933.2551-35-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 7980917EF for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 633092F3D1 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52AC52F359; Thu, 28 Feb 2019 22:20: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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 5A2742F3D6 for <patchwork-linux-security-module@patchwork.kernel.org>; Thu, 28 Feb 2019 22:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729779AbfB1WUJ (ORCPT <rfc822;patchwork-linux-security-module@patchwork.kernel.org>); Thu, 28 Feb 2019 17:20:09 -0500 Received: from sonic315-15.consmr.mail.gq1.yahoo.com ([98.137.65.39]:44350 "EHLO sonic315-15.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729874AbfB1WUH (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=s2048;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cXfmXbjk2Qk3ZMFYc.MWIdhEfvcIBsmknlyU.nvp73248s2KRYLHR3q4uQ21bATNmcVw 0KYYf1FeXwifiMUJGQBP_0E0TyQu_UYPJ9LbG8KU0iKhze4iEecC1ixW4FYNzco..ZCq6wO25ldT wOX8T5eWPusmj4dfdLFDtCg2i2m.nJILt.h_6uaUqyTvb2a0zQFNQWnzPmJeZooPZcDW242lTsFr yMfu9tC7KUpEekg_._nfjR1_FoofgmIvYz06vHKNYILwg_XQYEnp10.K43u0yuwYU6rFY24DEnke Tl5LZNbl9t1R5FmNjnanp.9BrJ.pVszT9jCtBExHXZHVg9qdpmjcMIpqhugAJ5KGBF68B5RrzrDK MFbSje9NmS09iks0eeoVN3gWC2eGCtWDmdYsx0CUVv9sW1YCjhA7IT0wwncbDx1lj_mSrIF9HQJp VtWq_My.5T6vudvnnB1ShsqDNJYtYCnI0Qp7DifbDN7pTdQIWEFJikmviZpp7nBBIIEvA60DKd7Z W8bVl5zkSJtvVyc0QgwkWRhsfOKo.IVope2mwrz4sL4sIuVIq 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 34/97] NET: Remove scaffolding on secmarks Date: Thu, 28 Feb 2019 14:18:30 -0800 Message-Id: <20190228221933.2551-35-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/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(-)