selinux/libsepol
Nicolas Iooss 914691cc2a libsepol: make role_list_destroy() do nothing when role_list is NULL
When a function called by sepol_module_policydb_to_cil() fails before
role_list_create() has been called, role_list is still NULL but is
dereferenced in role_list_destroy(). Here is a gdb session on hll/pp:

    Unknown value for handle-unknown: 6

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7a68a37 in role_list_destroy () at module_to_cil.c:215
    215     struct list_node *curr = role_list->head;

    (gdb) bt
    #0  0x00007ffff7a68a37 in role_list_destroy () at
    module_to_cil.c:215
    #1  sepol_module_policydb_to_cil (fp=fp@entry=0x7ffff79925e0
    <_IO_2_1_stdout_>, pdb=<optimized out>, linked=linked@entry=0) at
    module_to_cil.c:4060
    #2  0x00007ffff7a6ac75 in sepol_module_package_to_cil
    (fp=fp@entry=0x7ffff79925e0 <_IO_2_1_stdout_>, mod_pkg=0x604280) at
    module_to_cil.c:4080
    #3  0x0000000000401a58 in main (argc=<optimized out>,
    argv=<optimized out>) at pp.c:150

This issue has been found while fuzzing hll/pp with the American Fuzzy
Lop.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-05-24 17:13:58 -04:00
..
cil libsepol: Add IB end port handling to CIL 2017-05-23 16:20:55 -04:00
include semanage: Update semanage to allow runtime labeling of ibendports 2017-05-23 16:20:55 -04:00
man libsepol: constify sepol_genbools()'s boolpath parameter 2017-03-29 10:26:44 -04:00
src libsepol: make role_list_destroy() do nothing when role_list is NULL 2017-05-24 17:13:58 -04:00
tests libsepol/tests: fix -Wwrite-strings warnings 2017-02-06 11:06:04 -05:00
utils libsepol/utils: Fix build without system sepol.h 2017-05-05 15:48:22 -04:00
.gitignore libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
VERSION Update VERSION and ChangeLog files for 2.6 final release. 2016-10-14 11:31:26 -04:00