selinux/libselinux
Nicolas Iooss 55fe40ac77 libselinux: rework selabel_subs_init() to avoid use-after-free
In selabel_subs_init(), when digest_add_specfile() fails, the returned
value is a pointer to data which has been freed (because label "err"
frees variable "sub" which is equals to the returned variable, "list").

Moreover since since commit fd56c5230c ("Separate out the calling of
local subs and dist subs in selabel_sub"), argument "list" of
selabel_subs_init() has always been NULL (rec->subs and rec->dist_subs
are both initialized to NULL in selabel_open() before
selabel_file_init() is called).

Drop selabel_file_init()'s "list" argument and free all the list items
which have been allocated in this function, when the code encounters an
error.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-05-18 08:42:26 -04:00
..
include libselinux: add security_get_checkreqprot 2017-05-08 12:44:07 -04:00
man libselinux: add security_get_checkreqprot 2017-05-08 12:44:07 -04:00
src libselinux: rework selabel_subs_init() to avoid use-after-free 2017-05-18 08:42:26 -04:00
utils libselinux: Fix CFLAGS definition 2017-05-09 10:47:39 -04:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libselinux: PCRE_LDFLAGS is actually LDLIBS 2017-04-25 08:23:45 -04:00
VERSION Update VERSION and ChangeLog files for 2.6 final release. 2016-10-14 11:31:26 -04:00