public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Grund <theflamefire89@gmail.com>
To: stable@vger.kernel.org
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	Alexander Grund <theflamefire89@gmail.com>
Subject: [PATCH 4.9 1/6] selinux: Minor cleanups
Date: Sat, 30 Jul 2022 19:03:38 +0200	[thread overview]
Message-ID: <20220730170343.11477-2-theflamefire89@gmail.com> (raw)
In-Reply-To: <20220730170343.11477-1-theflamefire89@gmail.com>

From: Andreas Gruenbacher <agruenba@redhat.com>

commit 420591128cb206201dc444c2d42fb6f299b2ecd0 upstream.

Fix the comment for function __inode_security_revalidate, which returns
an integer.

Use the LABEL_* constants consistently for isec->initialized.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Alexander Grund <theflamefire89@gmail.com>
---
 security/selinux/hooks.c     | 3 ++-
 security/selinux/selinuxfs.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index eb503eccbacc..43f81db42169 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -237,6 +237,7 @@ static int inode_alloc_security(struct inode *inode)
 	isec->sid = SECINITSID_UNLABELED;
 	isec->sclass = SECCLASS_FILE;
 	isec->task_sid = sid;
+	isec->initialized = LABEL_INVALID;
 	inode->i_security = isec;
 
 	return 0;
@@ -247,7 +248,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
 /*
  * Try reloading inode security labels that have been marked as invalid.  The
  * @may_sleep parameter indicates when sleeping and thus reloading labels is
- * allowed; when set to false, returns ERR_PTR(-ECHILD) when the label is
+ * allowed; when set to false, returns -ECHILD when the label is
  * invalid.  The @opt_dentry parameter should be set to a dentry of the inode;
  * when no dentry is available, set it to NULL instead.
  */
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index ef1226c1c3ad..a033306d14ee 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1301,7 +1301,7 @@ static int sel_make_bools(void)
 			goto out;
 
 		isec->sid = sid;
-		isec->initialized = 1;
+		isec->initialized = LABEL_INITIALIZED;
 		inode->i_fop = &sel_bool_ops;
 		inode->i_ino = i|SEL_BOOL_INO_OFFSET;
 		d_add(dentry, inode);
@@ -1835,7 +1835,7 @@ static int sel_fill_super(struct super_block *sb, void *data, int silent)
 	isec = (struct inode_security_struct *)inode->i_security;
 	isec->sid = SECINITSID_DEVNULL;
 	isec->sclass = SECCLASS_CHR_FILE;
-	isec->initialized = 1;
+	isec->initialized = LABEL_INITIALIZED;
 
 	init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3));
 	d_add(dentry, inode);
-- 
2.25.1


  reply	other threads:[~2022-07-30 17:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30 17:03 [PATCH 4.9 0/6] Convert isec->lock into a spinlock fixing deadlock on GFS2 Alexander Grund
2022-07-30 17:03 ` Alexander Grund [this message]
2022-07-30 17:03 ` [PATCH 4.9 2/6] proc: Pass file mode to proc_pid_make_inode Alexander Grund
2022-07-30 17:03 ` [PATCH 4.9 3/6] selinux: Clean up initialization of isec->sclass Alexander Grund
2022-07-30 17:03 ` [PATCH 4.9 4/6] selinux: Convert isec->lock into a spinlock Alexander Grund
2022-07-30 17:03 ` [PATCH 4.9 5/6] selinux: fix error initialization in inode_doinit_with_dentry() Alexander Grund
2022-07-30 17:03 ` [PATCH 4.9 6/6] selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling Alexander Grund
2022-08-01 11:14 ` [PATCH 4.9 0/6] Convert isec->lock into a spinlock fixing deadlock on GFS2 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=20220730170343.11477-2-theflamefire89@gmail.com \
    --to=theflamefire89@gmail.com \
    --cc=agruenba@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox