Skip to contentSkip to conversation

selinux: check ss_initialized before revalidating an inode label

PATCH New Paul Moore 1 participant 1 message Apr 19, 2016 SELinux security module

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

PATCH 1/1 selinux: check ss_initialized before revalidating an inode label

From: Paul Moore <[email protected]>

There is no point in trying to revalidate an inode's security label if the security server is not yet initialized.

---
 security/selinux/hooks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/hooks.c +1 -1
index b09aad7..474011c 100644
@@ -259,7 +259,7 @@ static int __inode_security_revalidate(struct inode *inode,
 
 	might_sleep_if(may_sleep);
 
-	if (isec->initialized != LABEL_INITIALIZED) {
+	if (ss_initialized && isec->initialized != LABEL_INITIALIZED) {
 		if (!may_sleep)
 			return -ECHILD;