Message ID | 20230511123213.722912-1-cgzones@googlemail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4339525vqo; Thu, 11 May 2023 05:43:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5YL+suhD/ng1YUJvSUM7tGTrZcbobHYAzByxkZNGKqJje5brB3owrKKnuIxA179hLnQTYm X-Received: by 2002:a17:903:110f:b0:1a2:8c7e:f310 with SMTP id n15-20020a170903110f00b001a28c7ef310mr25497913plh.35.1683809024084; Thu, 11 May 2023 05:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683809024; cv=none; d=google.com; s=arc-20160816; b=w1y+hgRPDFMW6yGvYu9xZbgZm3I6oceInuutuMbZEQGPcfuLmZ4LPahJrMarhKMMa/ LzbZOiU+fLG+Y2cR+WfsBqgK5tYOGLGm7lavg8riDFzpmqZDME8GAdRrxXzpV0wBI1ND wLIs8+r/5Q3sCNdGX3KvmPVg3Fb2a4bK7DohGLxoeBdMiKn3Mc5mkEaSPdbr0Uq9NJ2A k/Gv9GsZSXgor0CHdgMSRbHUy4jOvLMa4DYz4MnEPHn37T8ViSGDG8g2EbqlghNGBPAS toNUnzSzVl9UpLivpIS1e6d7jE+RmJH6VnVy+WuTXEbAM6D0yy77Bt02lmcXL9MLtuD4 NPtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qpFCNWYEoyxGLamlVtGBTAfhhqfRF4QezHpbobxA/FY=; b=r4sLNPcYIiOzVsGf1J33F1VcMp2ZS4PXf/C0qho2UQoqKMJTvD6riNfOZKWuiV/09R cAvsTOt6vm88BwFW7fg7q7DOetULNmWHgmoFEnFX32VDzXGZ9qrYAmBtkmBK4RS68WIW 48KsiRdtGm+tsi1n4z5kpjCV+ZnnXe7tHnIXdYkO2pNQzJnZ/7k0b/RKXyTd7WyPK5cl 7fOunghWIOgAs+R02on1cvwdTMvYp0MkH+XPvKUQv8VAN7iL+vovHjuXWjuozJCo2O19 GJKoNxFPBTcfw4q3zkra7iupbmsFYLv44SC83jaCU6NO0+Dh6fdPNF7PsZA0S3wGtHbr +gHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=fWk5CuRJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a17090ad50d00b0024dfab55f54si20139613pju.79.2023.05.11.05.43.28; Thu, 11 May 2023 05:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=fWk5CuRJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237972AbjEKMc0 (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Thu, 11 May 2023 08:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237837AbjEKMcY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 11 May 2023 08:32:24 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7567D40F7; Thu, 11 May 2023 05:32:20 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-965e93f915aso1421923266b.2; Thu, 11 May 2023 05:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1683808339; x=1686400339; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qpFCNWYEoyxGLamlVtGBTAfhhqfRF4QezHpbobxA/FY=; b=fWk5CuRJg8SYKLgZdauP3BRsmpVS4LnfF9rI9/Sf343SLC8KtoXqjDWemvr9da8Qk5 0iq2yY9biC4KpgoP09qQKJN87l0ovf11apQukRf1cMMMQ06ykxXjHevCZ1g8JfioKqxB c4PbvJKiUTEGbMIceJzcMuTEQCczkUNAiiIK6qSU8eZ9G0NWQ74VCluNKnEOmJ1DXnm6 AUMFpSoXG5sXDbULn+2h06ujQAu7wha4QQKrd9rKpvP0V6xkQ9O3+Vbn/eWcdYTz3Fag KKQhw62AhnlM9NCKEhLSwpXPkL/L+Ay5k0Ie5EnYcDr/xQbquLcjDAK61kkZycvY78S2 ibDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683808339; x=1686400339; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qpFCNWYEoyxGLamlVtGBTAfhhqfRF4QezHpbobxA/FY=; b=VZIWWOrNV2oTNQetfEIby/+qCTvji15TlkfJeTsbHaxvaosurtT39guujX2Lied6Dp +Zx700XSApbC64juOV99av43tSCYJ6pgl1v2cEfPchlwa6sj8HUZbheZCekag0HduKKd 0ZqJOKE2qaOmTdQCLYAYYSn2RVBKLvFOY8wEKuF5tLtiGtSeTHo1sVyCqZSrjwICPUrL kv0GOscqlWYETeYHe05VIB3qJ6uZon/54/doQApb1uLKMzPCiEwbomN3MdU8//8HtDNe Oe/8WsXD4w6Yympmd0u+FJ0XW+5peCrXzpHQXQXxI6LBlqC6i+Hidch3dFehVbZj+0vL z7Pw== X-Gm-Message-State: AC+VfDyKViYPihSHjCQsHLn9f5zB+/4v05yBCMl8MBzc4KJ1ei1AWbQA WM4CGYKrHeeWgaam3HsxnmM/QOwoeIk= X-Received: by 2002:a17:907:629e:b0:946:be05:ed7a with SMTP id nd30-20020a170907629e00b00946be05ed7amr19143790ejc.70.1683808338695; Thu, 11 May 2023 05:32:18 -0700 (PDT) Received: from debianHome.localdomain (dynamic-077-008-180-228.77.8.pool.telefonica.de. [77.8.180.228]) by smtp.gmail.com with ESMTPSA id x4-20020a1709060a4400b0095ed3befbedsm3949057ejf.54.2023.05.11.05.32.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 05:32:18 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com> To: selinux@vger.kernel.org Cc: Paul Moore <paul@paul-moore.com>, Stephen Smalley <stephen.smalley.work@gmail.com>, Eric Paris <eparis@parisplace.org>, Xiu Jianfeng <xiujianfeng@huawei.com>, linux-kernel@vger.kernel.org Subject: [PATCH] selinux: deprecated fs ocon Date: Thu, 11 May 2023 14:32:12 +0200 Message-Id: <20230511123213.722912-1-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765601731580543009?= X-GMAIL-MSGID: =?utf-8?q?1765601731580543009?= |
Series |
selinux: deprecated fs ocon
|
|
Commit Message
Christian Göttsche
May 11, 2023, 12:32 p.m. UTC
The object context type `fs`, not to be confused with the well used
object context type `fscon`, was introduced in the initial git commit
1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since.
The paper "A Security Policy Configuration for the Security-Enhanced
Linux" [1] mentions it under `7.2 File System Contexts` but also states:
Currently, this configuration is unused.
The policy statement defining such object contexts is `fscon`, e.g.:
fscon 2 3 gen_context(system_u:object_r:conA_t,s0) gen_context(system_u:object_r:conB_t,s0)
It is not documented at selinuxproject.org or in the SELinux notebook
and not supported by the Reference Policy buildsystem - the statement is
not properly sorted - and thus not used in the Reference or Fedora
Policy.
Print a warning message at policy load for each such object context:
SELinux: void and deprecated fs ocon 02:03
This topic was initially highlighted by Nicolas Iooss [2].
[1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF
[2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
security/selinux/ss/policydb.c | 4 ++++
security/selinux/ss/policydb.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
Comments
On May 11, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote: > > The object context type `fs`, not to be confused with the well used > object context type `fscon`, was introduced in the initial git commit > 1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since. > > The paper "A Security Policy Configuration for the Security-Enhanced > Linux" [1] mentions it under `7.2 File System Contexts` but also states: > > Currently, this configuration is unused. > > The policy statement defining such object contexts is `fscon`, e.g.: > > fscon 2 3 gen_context(system_u:object_r:conA_t,s0) gen_context(system_u:object_r:conB_t,s0) > > It is not documented at selinuxproject.org or in the SELinux notebook > and not supported by the Reference Policy buildsystem - the statement is > not properly sorted - and thus not used in the Reference or Fedora > Policy. > > Print a warning message at policy load for each such object context: > > SELinux: void and deprecated fs ocon 02:03 > > This topic was initially highlighted by Nicolas Iooss [2]. > > [1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF > [2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/ > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> > --- > security/selinux/ss/policydb.c | 4 ++++ > security/selinux/ss/policydb.h | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) Thanks, this is a nice catch, although some minor suggestions below ... > diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c > index 97c0074f9312..31b08b34c722 100644 > --- a/security/selinux/ss/policydb.c > +++ b/security/selinux/ss/policydb.c > @@ -2257,6 +2257,10 @@ static int ocontext_read(struct policydb *p, const struct policydb_compat_info * > if (rc) > goto out; > > + if (i == OCON_FS) > + pr_warn("SELinux: void and deprecated fs ocon %s\n", > + c->u.name); Instead of having to check if 'i == OCON_FS', why not simply put the pr_warn() call up in the OCON_FS case block on line ~2249 and let it continue to fallthrough to the OCON_NETIF block? > rc = context_read_and_validate(&c->context[0], p, fp); > if (rc) > goto out; > diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h > index ffc4e7bad205..39cd6222e1a8 100644 > --- a/security/selinux/ss/policydb.h > +++ b/security/selinux/ss/policydb.h > @@ -225,7 +225,7 @@ struct genfs { > > /* object context array indices */ > #define OCON_ISID 0 /* initial SIDs */ > -#define OCON_FS 1 /* unlabeled file systems */ > +#define OCON_FS 1 /* unlabeled file systems (deprecated in 6.5) */ Since you are likely re-spinning this (see above), I would just leave it as "(deprecated)"; those that want to know where it was deprecated can always check the git log/tags. > #define OCON_PORT 2 /* TCP and UDP port numbers */ > #define OCON_NETIF 3 /* network interfaces */ > #define OCON_NODE 4 /* nodes */ > -- > 2.40.1 -- paul-moore.com
On Thu, May 18, 2023 at 1:56 PM Paul Moore <paul@paul-moore.com> wrote: > On May 11, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote: > > > > The object context type `fs`, not to be confused with the well used > > object context type `fscon`, was introduced in the initial git commit > > 1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since. > > > > The paper "A Security Policy Configuration for the Security-Enhanced > > Linux" [1] mentions it under `7.2 File System Contexts` but also states: > > > > Currently, this configuration is unused. > > > > The policy statement defining such object contexts is `fscon`, e.g.: > > > > fscon 2 3 gen_context(system_u:object_r:conA_t,s0) gen_context(system_u:object_r:conB_t,s0) > > > > It is not documented at selinuxproject.org or in the SELinux notebook > > and not supported by the Reference Policy buildsystem - the statement is > > not properly sorted - and thus not used in the Reference or Fedora > > Policy. > > > > Print a warning message at policy load for each such object context: > > > > SELinux: void and deprecated fs ocon 02:03 > > > > This topic was initially highlighted by Nicolas Iooss [2]. > > > > [1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF > > [2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/ > > > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> > > --- > > security/selinux/ss/policydb.c | 4 ++++ > > security/selinux/ss/policydb.h | 2 +- > > 2 files changed, 5 insertions(+), 1 deletion(-) > > Thanks, this is a nice catch, although some minor suggestions below ... > > > diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c > > index 97c0074f9312..31b08b34c722 100644 > > --- a/security/selinux/ss/policydb.c > > +++ b/security/selinux/ss/policydb.c > > @@ -2257,6 +2257,10 @@ static int ocontext_read(struct policydb *p, const struct policydb_compat_info * > > if (rc) > > goto out; > > > > + if (i == OCON_FS) > > + pr_warn("SELinux: void and deprecated fs ocon %s\n", > > + c->u.name); > > Instead of having to check if 'i == OCON_FS', why not simply put the > pr_warn() call up in the OCON_FS case block on line ~2249 and let it > continue to fallthrough to the OCON_NETIF block? Bah, nevermind, you need to leave it here because of the 'c->u.name' in the pr_warn(). If you're okay with me adjusting the deprecation comment (below) during the merge I'll can merge this now ... ? > > rc = context_read_and_validate(&c->context[0], p, fp); > > if (rc) > > goto out; > > diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h > > index ffc4e7bad205..39cd6222e1a8 100644 > > --- a/security/selinux/ss/policydb.h > > +++ b/security/selinux/ss/policydb.h > > @@ -225,7 +225,7 @@ struct genfs { > > > > /* object context array indices */ > > #define OCON_ISID 0 /* initial SIDs */ > > -#define OCON_FS 1 /* unlabeled file systems */ > > +#define OCON_FS 1 /* unlabeled file systems (deprecated in 6.5) */ > > Since you are likely re-spinning this (see above), I would just leave > it as "(deprecated)"; those that want to know where it was deprecated > can always check the git log/tags. > > > #define OCON_PORT 2 /* TCP and UDP port numbers */ > > #define OCON_NETIF 3 /* network interfaces */ > > #define OCON_NODE 4 /* nodes */ > > -- > > 2.40.1
On Thu, 18 May 2023 at 22:18, Paul Moore <paul@paul-moore.com> wrote: > > On Thu, May 18, 2023 at 1:56 PM Paul Moore <paul@paul-moore.com> wrote: > > On May 11, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote: > > > > > > The object context type `fs`, not to be confused with the well used > > > object context type `fscon`, was introduced in the initial git commit > > > 1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since. > > > > > > The paper "A Security Policy Configuration for the Security-Enhanced > > > Linux" [1] mentions it under `7.2 File System Contexts` but also states: > > > > > > Currently, this configuration is unused. > > > > > > The policy statement defining such object contexts is `fscon`, e.g.: > > > > > > fscon 2 3 gen_context(system_u:object_r:conA_t,s0) gen_context(system_u:object_r:conB_t,s0) > > > > > > It is not documented at selinuxproject.org or in the SELinux notebook > > > and not supported by the Reference Policy buildsystem - the statement is > > > not properly sorted - and thus not used in the Reference or Fedora > > > Policy. > > > > > > Print a warning message at policy load for each such object context: > > > > > > SELinux: void and deprecated fs ocon 02:03 > > > > > > This topic was initially highlighted by Nicolas Iooss [2]. > > > > > > [1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF > > > [2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/ > > > > > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> > > > --- > > > security/selinux/ss/policydb.c | 4 ++++ > > > security/selinux/ss/policydb.h | 2 +- > > > 2 files changed, 5 insertions(+), 1 deletion(-) > > > > Thanks, this is a nice catch, although some minor suggestions below ... > > > > > diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c > > > index 97c0074f9312..31b08b34c722 100644 > > > --- a/security/selinux/ss/policydb.c > > > +++ b/security/selinux/ss/policydb.c > > > @@ -2257,6 +2257,10 @@ static int ocontext_read(struct policydb *p, const struct policydb_compat_info * > > > if (rc) > > > goto out; > > > > > > + if (i == OCON_FS) > > > + pr_warn("SELinux: void and deprecated fs ocon %s\n", > > > + c->u.name); > > > > Instead of having to check if 'i == OCON_FS', why not simply put the > > pr_warn() call up in the OCON_FS case block on line ~2249 and let it > > continue to fallthrough to the OCON_NETIF block? > > Bah, nevermind, you need to leave it here because of the 'c->u.name' > in the pr_warn(). If you're okay with me adjusting the deprecation > comment (below) during the merge I'll can merge this now ... ? Yes, please feel free to adjust the inline comment. > > > > rc = context_read_and_validate(&c->context[0], p, fp); > > > if (rc) > > > goto out; > > > diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h > > > index ffc4e7bad205..39cd6222e1a8 100644 > > > --- a/security/selinux/ss/policydb.h > > > +++ b/security/selinux/ss/policydb.h > > > @@ -225,7 +225,7 @@ struct genfs { > > > > > > /* object context array indices */ > > > #define OCON_ISID 0 /* initial SIDs */ > > > -#define OCON_FS 1 /* unlabeled file systems */ > > > +#define OCON_FS 1 /* unlabeled file systems (deprecated in 6.5) */ > > > > Since you are likely re-spinning this (see above), I would just leave > > it as "(deprecated)"; those that want to know where it was deprecated > > can always check the git log/tags. > > > > > #define OCON_PORT 2 /* TCP and UDP port numbers */ > > > #define OCON_NETIF 3 /* network interfaces */ > > > #define OCON_NODE 4 /* nodes */ > > > -- > > > 2.40.1 > > -- > paul-moore.com
On Tue, May 23, 2023 at 2:25 PM Christian Göttsche <cgzones@googlemail.com> wrote: > On Thu, 18 May 2023 at 22:18, Paul Moore <paul@paul-moore.com> wrote: > > On Thu, May 18, 2023 at 1:56 PM Paul Moore <paul@paul-moore.com> wrote: > > > On May 11, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote: > > > > > > > > The object context type `fs`, not to be confused with the well used > > > > object context type `fscon`, was introduced in the initial git commit > > > > 1da177e4c3f4 ("Linux-2.6.12-rc2") but never actually used since. > > > > > > > > The paper "A Security Policy Configuration for the Security-Enhanced > > > > Linux" [1] mentions it under `7.2 File System Contexts` but also states: > > > > > > > > Currently, this configuration is unused. > > > > > > > > The policy statement defining such object contexts is `fscon`, e.g.: > > > > > > > > fscon 2 3 gen_context(system_u:object_r:conA_t,s0) gen_context(system_u:object_r:conB_t,s0) > > > > > > > > It is not documented at selinuxproject.org or in the SELinux notebook > > > > and not supported by the Reference Policy buildsystem - the statement is > > > > not properly sorted - and thus not used in the Reference or Fedora > > > > Policy. > > > > > > > > Print a warning message at policy load for each such object context: > > > > > > > > SELinux: void and deprecated fs ocon 02:03 > > > > > > > > This topic was initially highlighted by Nicolas Iooss [2]. > > > > > > > > [1]: https://media.defense.gov/2021/Jul/29/2002815735/-1/-1/0/SELINUX-SECURITY-POLICY-CONFIGURATION-REPORT.PDF > > > > [2]: https://lore.kernel.org/selinux/CAJfZ7=mP2eJaq2BfO3y0VnwUJaY2cS2p=HZMN71z1pKjzaT0Eg@mail.gmail.com/ > > > > > > > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> > > > > --- > > > > security/selinux/ss/policydb.c | 4 ++++ > > > > security/selinux/ss/policydb.h | 2 +- > > > > 2 files changed, 5 insertions(+), 1 deletion(-) > > > > > > Thanks, this is a nice catch, although some minor suggestions below ... > > > > > > > diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c > > > > index 97c0074f9312..31b08b34c722 100644 > > > > --- a/security/selinux/ss/policydb.c > > > > +++ b/security/selinux/ss/policydb.c > > > > @@ -2257,6 +2257,10 @@ static int ocontext_read(struct policydb *p, const struct policydb_compat_info * > > > > if (rc) > > > > goto out; > > > > > > > > + if (i == OCON_FS) > > > > + pr_warn("SELinux: void and deprecated fs ocon %s\n", > > > > + c->u.name); > > > > > > Instead of having to check if 'i == OCON_FS', why not simply put the > > > pr_warn() call up in the OCON_FS case block on line ~2249 and let it > > > continue to fallthrough to the OCON_NETIF block? > > > > Bah, nevermind, you need to leave it here because of the 'c->u.name' > > in the pr_warn(). If you're okay with me adjusting the deprecation > > comment (below) during the merge I'll can merge this now ... ? > > Yes, please feel free to adjust the inline comment. Okay, done and merged into selinux/next, thanks.
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 97c0074f9312..31b08b34c722 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -2257,6 +2257,10 @@ static int ocontext_read(struct policydb *p, const struct policydb_compat_info * if (rc) goto out; + if (i == OCON_FS) + pr_warn("SELinux: void and deprecated fs ocon %s\n", + c->u.name); + rc = context_read_and_validate(&c->context[0], p, fp); if (rc) goto out; diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h index ffc4e7bad205..39cd6222e1a8 100644 --- a/security/selinux/ss/policydb.h +++ b/security/selinux/ss/policydb.h @@ -225,7 +225,7 @@ struct genfs { /* object context array indices */ #define OCON_ISID 0 /* initial SIDs */ -#define OCON_FS 1 /* unlabeled file systems */ +#define OCON_FS 1 /* unlabeled file systems (deprecated in 6.5) */ #define OCON_PORT 2 /* TCP and UDP port numbers */ #define OCON_NETIF 3 /* network interfaces */ #define OCON_NODE 4 /* nodes */