selinux/libsepol/src
Christian Göttsche 474b271b1b libsepol: free memory after policy validation
Found while running the checkpolicy/test/dispol binary.

    Direct leak of 24 byte(s) in 1 object(s) allocated from:
        #0 0x49bacd in __interceptor_malloc (./checkpolicy/test/dispol+0x49bacd)
        #1 0x5551e1 in ebitmap_set_bit ./libsepol/src/ebitmap.c:326:27
        #2 0x517873 in create_gap_ebitmap ./libsepol/src/policydb_validate.c:23:8
        #3 0x517873 in validate_init ./libsepol/src/policydb_validate.c:34:6
        #4 0x50fa47 in validate_array_init ./libsepol/src/policydb_validate.c:44:6
        #5 0x50fa47 in validate_policydb ./libsepol/src/policydb_validate.c:732:6
        #6 0x4f22df in policydb_read ./libsepol/src/policydb.c:4538:6
        #7 0x4cddb3 in main ./checkpolicy/test/dispol.c:437:8
        #8 0x7f5980e47e49 in __libc_start_main csu/../csu/libc-start.c:314:16

    Indirect leak of 48 byte(s) in 2 object(s) allocated from:
        #0 0x49bacd in __interceptor_malloc (./checkpolicy/test/dispol+0x49bacd)
        #1 0x5551e1 in ebitmap_set_bit ./libsepol/src/ebitmap.c:326:27
        #2 0x517873 in create_gap_ebitmap ./libsepol/src/policydb_validate.c:23:8
        #3 0x517873 in validate_init ./libsepol/src/policydb_validate.c:34:6
        #4 0x50fa47 in validate_array_init ./libsepol/src/policydb_validate.c:44:6
        #5 0x50fa47 in validate_policydb ./libsepol/src/policydb_validate.c:732:6
        #6 0x4f22df in policydb_read ./libsepol/src/policydb.c:4538:6
        #7 0x4cddb3 in main ./checkpolicy/test/dispol.c:437:8
        #8 0x7f5980e47e49 in __libc_start_main csu/../csu/libc-start.c:314:16

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-09-15 10:13:37 -04:00
..
assertion.c libsepol: resolve missing prototypes 2021-06-24 09:39:22 -04:00
avrule_block.c libsepol: declare read-only arrays const 2021-06-24 09:41:30 -04:00
avtab.c libsepol: ignore UBSAN false-positives 2021-07-13 21:01:03 +02:00
boolean_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
boolean_record.c libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
booleans.c libsepol: follow declaration-after-statement 2021-06-24 09:39:56 -04:00
conditional.c libsepol: remove dead stores 2021-06-24 09:40:10 -04:00
constraint.c libsepol/cil: fix memory leak when a constraint expression is too deep 2021-02-03 09:28:39 +01:00
context_internal.h libsepol: resolve missing prototypes 2021-06-24 09:39:22 -04:00
context_record.c libsepol: use checked arithmetic builtin to perform safe addition 2021-04-30 21:09:36 +02:00
context.c Remove unneeded int 2019-06-19 09:03:03 -07:00
context.h
debug.c libsepol: follow declaration-after-statement 2021-06-24 09:39:56 -04:00
debug.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
ebitmap.c libsepol: mark read-only parameters of ebitmap interfaces const 2021-06-24 09:40:18 -04:00
expand.c libsepol: avoid implicit conversions 2021-07-13 21:01:07 +02:00
flask.h libsepol,checkpolicy: remove use of hardcoded security class values 2020-03-12 07:50:55 +01:00
handle.c
handle.h
hashtab.c libsepol: grow hashtab dynamically 2020-02-21 15:15:41 -05:00
hierarchy.c libsepol: add ebitmap_for_each_set_bit macro 2019-05-20 14:00:32 -04:00
ibendport_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
ibendport_record.c libsepol: assure string NUL-termination of ibdev_name 2021-07-13 21:01:11 +02:00
ibendports.c libsepol: assure string NUL-termination of ibdev_name 2021-07-13 21:01:11 +02:00
ibpkey_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
ibpkey_record.c libsepol: replace strerror by %m 2021-08-10 14:21:28 -04:00
ibpkeys.c
iface_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
iface_record.c libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
interfaces.c
kernel_to_cil.c libsepol: Fix detected RESOURCE_LEAKs 2021-09-08 09:44:59 +02:00
kernel_to_common.c libsepol: Sort portcon rules consistently 2020-06-02 13:28:11 -04:00
kernel_to_common.h
kernel_to_conf.c libsepol: Fix detected RESOURCE_LEAKs 2021-09-08 09:44:59 +02:00
libsepol.map.in libsepol/cil: Provide option to allow qualified names in declarations 2021-07-03 16:00:26 +02:00
libsepol.pc.in
link.c libsepol: declare read-only arrays const 2021-06-24 09:41:30 -04:00
Makefile libsepol: Bump libsepol.so version 2020-10-19 22:11:39 +02:00
mls.c libsepol: uniformize prototypes of sepol_mls_contains and sepol_mls_check 2021-02-05 10:19:34 +01:00
mls.h
module_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
module_to_cil.c libsepol: fix typo 2021-09-13 15:41:02 +02:00
module.c libsepol: replace strerror by %m 2021-08-10 14:21:28 -04:00
node_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
node_record.c libsepol: replace strerror by %m 2021-08-10 14:21:28 -04:00
nodes.c libsepol: follow declaration-after-statement 2021-06-24 09:39:56 -04:00
optimize.c libsepol: speed up policy optimization 2020-03-19 15:32:29 -04:00
polcaps.c libsepol: declare read-only arrays const 2021-06-24 09:41:30 -04:00
policydb_convert.c
policydb_internal.h libsepol: declare read-only arrays const 2021-06-24 09:41:30 -04:00
policydb_public.c libsepol: invalidate the pointer to the policydb if policydb_init fails 2021-03-03 07:52:59 +01:00
policydb_validate.c libsepol: free memory after policy validation 2021-09-15 10:13:37 -04:00
policydb_validate.h libsepol: Validate policydb values when reading binary policy 2021-02-19 16:34:47 +01:00
policydb.c libsepol: ignore UBSAN false-positives 2021-07-13 21:01:03 +02:00
port_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
port_record.c libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
ports.c
private.h libsepol: ignore UBSAN false-positives 2021-07-13 21:01:03 +02:00
services.c libsepol: replace strerror by %m 2021-08-10 14:21:28 -04:00
sidtab.c libsepol: remove unused functions 2021-06-24 09:39:41 -04:00
symtab.c libsepol: ignore UBSAN false-positives 2021-07-13 21:01:03 +02:00
user_internal.h libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
user_record.c libsepol/dso: drop hidden_proto and hidden_def 2020-03-17 13:42:59 -04:00
users.c libsepol: add ebitmap_for_each_set_bit macro 2019-05-20 14:00:32 -04:00
util.c libsepol: avoid implicit conversions 2021-09-15 10:13:30 -04:00
write.c libsepol: declare read-only arrays const 2021-06-24 09:41:30 -04:00