summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2016-03-28 15:16:53 -0400
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:52:01 +0300
commitf41375dfdccf9e1c59e4ba83c3e90ed40267bf8a (patch)
treef1207b889c3ff34f20245afeb7baf22e328d3fa3
parent07b510cbe28640e5de450afe44375a962f8b3560 (diff)
selinux: simply inode label states to INVALID and INITIALIZED
There really is no need for LABEL_MISSING as we really only care if the inode's label is INVALID or INITIALIZED. Also adjust the revalidate code to reload the label whenever the label is not INITIALIZED so we are less sensitive to label state in the future. Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--security/selinux/hooks.c2
-rw-r--r--security/selinux/include/objsec.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 62322ebf1221..cbbd85115ef3 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -260,7 +260,7 @@ static int __inode_security_revalidate(struct inode *inode,
might_sleep_if(may_sleep);
- if (isec->initialized == LABEL_INVALID) {
+ if (isec->initialized != LABEL_INITIALIZED) {
if (!may_sleep)
return -ECHILD;
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 4aaa3e7d48a4..a18686d4fbf4 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -37,9 +37,8 @@ struct task_security_struct {
};
enum label_initialized {
- LABEL_MISSING, /* not initialized */
- LABEL_INITIALIZED, /* inizialized */
- LABEL_INVALID /* invalid */
+ LABEL_INVALID, /* invalid or not initialized */
+ LABEL_INITIALIZED /* initialized */
};
struct inode_security_struct {