Skip to content

Commit

Permalink
SELinux: if sel_make_bools errors don't leave inconsistent state
Browse files Browse the repository at this point in the history
We reset the bool names and values array to NULL, but do not reset the
number of entries in these arrays to 0.  If we error out and then get back
into this function we will walk these NULL pointers based on the belief
that they are non-zero length.

Signed-off-by: Eric Paris <eparis@redhat.com>
cc: stable@kernel.org
  • Loading branch information
Eric Paris committed Apr 9, 2012
1 parent 92ae9e8 commit 154c50c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ static int sel_make_bools(void)
kfree(bool_pending_names[i]);
kfree(bool_pending_names);
kfree(bool_pending_values);
bool_num = 0;
bool_pending_names = NULL;
bool_pending_values = NULL;

Expand Down

0 comments on commit 154c50c

Please sign in to comment.