Skip to content

Commit

Permalink
[PATCH] selinuxfs cleanups: sel_make_bools
Browse files Browse the repository at this point in the history
Remove the call to sel_make_bools() from sel_fill_super(), as policy needs to
be loaded before the boolean files can be created.  Policy will never be
loaded during sel_fill_super() as selinuxfs is kernel mounted during init and
the only means to load policy is via selinuxfs.

Also, the call to d_genocide() on the error path of sel_make_bools() is
incorrect and replaced with sel_remove_bools().

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
James Morris authored and Linus Torvalds committed Mar 22, 2006
1 parent 161ce45 commit 253a8b1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ static int sel_make_bools(void)
return ret;
err:
kfree(values);
d_genocide(dir);
sel_remove_bools(dir);
ret = -ENOMEM;
goto out;
}
Expand Down Expand Up @@ -1226,9 +1226,6 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto err;

bool_dir = dentry;
ret = sel_make_bools();
if (ret)
goto err;

dentry = d_alloc_name(sb->s_root, NULL_FILE_NAME);
if (!dentry) {
Expand Down

0 comments on commit 253a8b1

Please sign in to comment.