mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neill Kapron <nkapron@google.com>
To: Paul Moore <paul@paul-moore.com>,
	Stephen Smalley <stephen.smalley.work@gmail.com>,
	 Ondrej Mosnacek <omosnace@redhat.com>,
	Neill Kapron <nkapron@google.com>
Cc: kernel-team@android.com, selinux@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: [PATCH] selinux: fix logic issue with per-file labeling for functionfs
Date: Fri,  5 Sep 2025 22:26:55 +0000	[thread overview]
Message-ID: <20250905222656.3692837-1-nkapron@google.com> (raw)

This patch resolves a logic issue with selinux_set_mnt_opts when
selinux_policycap_functionfs_seclabel is enabled. The issue was
introduced between v1 and v2 of the original patchset.

Fixes: 1b22454bb5e6 ("selinux: enable per-file labeling for functionfs")
Signed-off-by: Neill Kapron <nkapron@google.com>
---
 security/selinux/hooks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 333bb6cba25e..0e47b4bb8d40 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -745,7 +745,7 @@ static int selinux_set_mnt_opts(struct super_block *sb,
 	    !strcmp(sb->s_type->name, "pstore") ||
 	    !strcmp(sb->s_type->name, "securityfs") ||
 	    (selinux_policycap_functionfs_seclabel() &&
-	     strcmp(sb->s_type->name, "functionfs")))
+	     !strcmp(sb->s_type->name, "functionfs")))
 		sbsec->flags |= SE_SBGENFS;
 
 	if (!strcmp(sb->s_type->name, "sysfs") ||
-- 
2.51.0.355.g5224444f11-goog


             reply	other threads:[~2025-09-05 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 22:26 Neill Kapron [this message]
2025-09-06  2:13 ` Paul Moore
2025-09-06  3:15   ` Neill Kapron
2025-09-07 16:58     ` Paul Moore
2025-09-07 18:46       ` Neill Kapron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250905222656.3692837-1-nkapron@google.com \
    --to=nkapron@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®