All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Grund <theflamefire89@gmail.com>
To: stable@vger.kernel.org
Cc: Ondrej Mosnacek <omosnace@redhat.com>,
	Alexander Grund <theflamefire89@gmail.com>
Subject: [PATCH 4.9 1/1] selinux: drop super_block backpointer from superblock_security_struct
Date: Mon,  8 Aug 2022 13:59:22 +0200	[thread overview]
Message-ID: <20220808115922.331003-2-theflamefire89@gmail.com> (raw)
In-Reply-To: <20220808115922.331003-1-theflamefire89@gmail.com>

From: Ondrej Mosnacek <omosnace@redhat.com>

commit b159e86b5a2ab826b3a292756072f4cc523675ab upstream.

It appears to have been needed for selinux_complete_init() in the past,
but today it's useless.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
[AG: Backported to 4.9]
Signed-off-by: Alexander Grund <theflamefire89@gmail.com>
---
 security/selinux/hooks.c          | 5 ++---
 security/selinux/include/objsec.h | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index eb503eccbacc8..d446b501334ab 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -390,7 +390,6 @@ static int superblock_alloc_security(struct super_block *sb)
 	mutex_init(&sbsec->lock);
 	INIT_LIST_HEAD(&sbsec->isec_head);
 	spin_lock_init(&sbsec->isec_lock);
-	sbsec->sb = sb;
 	sbsec->sid = SECINITSID_UNLABELED;
 	sbsec->def_sid = SECINITSID_FILE;
 	sbsec->mntpoint_sid = SECINITSID_UNLABELED;
@@ -643,7 +642,7 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
 		opts->mnt_opts_flags[i++] = DEFCONTEXT_MNT;
 	}
 	if (sbsec->flags & ROOTCONTEXT_MNT) {
-		struct dentry *root = sbsec->sb->s_root;
+		struct dentry *root = sb->s_root;
 		struct inode_security_struct *isec = backing_inode_security(root);
 
 		rc = security_sid_to_context(isec->sid, &context, &len);
@@ -699,7 +698,7 @@ static int selinux_set_mnt_opts(struct super_block *sb,
 	int rc = 0, i;
 	struct superblock_security_struct *sbsec = sb->s_security;
 	const char *name = sb->s_type->name;
-	struct dentry *root = sbsec->sb->s_root;
+	struct dentry *root = sb->s_root;
 	struct inode_security_struct *root_isec;
 	u32 fscontext_sid = 0, context_sid = 0, rootcontext_sid = 0;
 	u32 defcontext_sid = 0;
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index c21e135460a5e..e4ad5fa58c6b0 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -63,7 +63,6 @@ struct file_security_struct {
 };
 
 struct superblock_security_struct {
-	struct super_block *sb;		/* back pointer to sb object */
 	u32 sid;			/* SID of file system superblock */
 	u32 def_sid;			/* default SID for labeling */
 	u32 mntpoint_sid;		/* SECURITY_FS_USE_MNTPOINT context for files */
-- 
2.25.1


  reply	other threads:[~2022-08-08 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 11:59 [PATCH 4.9 0/1] selinux: drop super_block backpointer from superblock_security_struct Alexander Grund
2022-08-08 11:59 ` Alexander Grund [this message]
2022-08-08 13:28 ` Greg KH
2022-08-11  9:46   ` Alexander Grund
2022-08-11 10:20     ` Greg KH
2022-08-11 10:21     ` Greg KH
2022-08-11 11:04       ` Alexander Grund
2022-08-11 13:46         ` Greg KH

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=20220808115922.331003-2-theflamefire89@gmail.com \
    --to=theflamefire89@gmail.com \
    --cc=omosnace@redhat.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.