Skip to content
Commit 70caa32e authored by Vratislav Bendel's avatar Vratislav Bendel Committed by Greg Kroah-Hartman
Browse files

selinux: fix double free of cond_list on error paths

commit 186edf7e

 upstream.

On error path from cond_read_list() and duplicate_policydb_cond_list()
the cond_list_destroy() gets called a second time in caller functions,
resulting in NULL pointer deref.  Fix this by resetting the
cond_list_len to 0 in cond_list_destroy(), making subsequent calls a
noop.

Also consistently reset the cond_list pointer to NULL after freeing.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarVratislav Bendel <vbendel@redhat.com>
[PM: fix line lengths in the description]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d63d077f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment