Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -4
+1 -1
security/selinux/hooks.c
··· 259 259 260 260 might_sleep_if(may_sleep); 261 261 262 - if (isec->initialized == LABEL_INVALID) { 262 + if (isec->initialized != LABEL_INITIALIZED) { 263 263 if (!may_sleep) 264 264 return -ECHILD; 265 265
+2 -3
security/selinux/include/objsec.h
··· 38 38 }; 39 39 40 40 enum label_initialized { 41 - LABEL_MISSING, /* not initialized */ 42 - LABEL_INITIALIZED, /* inizialized */ 43 - LABEL_INVALID /* invalid */ 41 + LABEL_INVALID, /* invalid or not initialized */ 42 + LABEL_INITIALIZED /* initialized */ 44 43 }; 45 44 46 45 struct inode_security_struct {