]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
selinux: Minor cleanups
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 10 Nov 2016 21:18:27 +0000 (22:18 +0100)
committerPaul Moore <paul@paul-moore.com>
Mon, 14 Nov 2016 20:25:07 +0000 (15:25 -0500)
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>
security/selinux/hooks.c
security/selinux/selinuxfs.c

index d1b141e33ecb59876a58542f12524c050999f4ea..1c0721708cccbdfde346598f43d555fcf0c4fcc9 100644 (file)
@@ -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.
  */
index 72c145dd799f175c09b98a9e6c9fa52fca4009b5..50fca204d3f1d89f3c3c85cccf2998a38a1750d4 100644 (file)
@@ -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);
@@ -1834,7 +1834,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);