Explorar o código

selinux: check ss_initialized before revalidating an inode label

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

Signed-off-by: Paul Moore <paul@paul-moore.com>
Paul Moore %!s(int64=9) %!d(string=hai) anos
pai
achega
1ac4247626
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      security/selinux/hooks.c

+ 1 - 1
security/selinux/hooks.c

@@ -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;