mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-18 12:14:33 +00:00
fe16f586d5
In checkpolicy, a sensitivity that has one or more aliases will temporarily share the mls_level_t structure with its aliases until a level statement is processed for the sensitivity (or one of the aliases) and the aliases are updated to have their own mls_level_t structure. If the policydb is destroyed while they are sharing the mls_level_t structure, then a double free of the shared mls_level_t will occur. This does not currently occur only because checkpolicy does very little clean-up before exiting. The "defined" field of the level_datum_t is set after a level statement is processed for a sensitivity and its aliases. This means that we know an alias has its own mls_level_t if the "defined" field is set. The double free can be avoided by not destroying the mls_leve_t structure for an alias unless the "defined" field is set. Since the "defined" field is only set to false while the mls_level_t structure is being shared, it would be clearer to rename the field as "notdefined". It would only be set during the time the sensitivity and its aliases are sharing the mls_level_t structure. Outside of checkpolicy, the "notdefined" field will always be set to 0. Also, do more validation of the level_datum_t when validating the policydb. Signed-off-by: James Carter <jwcart2@gmail.com> |
||
---|---|---|
.. | ||
policydb | ||
boolean_record.h | ||
booleans.h | ||
context_record.h | ||
context.h | ||
debug.h | ||
errcodes.h | ||
handle.h | ||
ibendport_record.h | ||
ibendports.h | ||
ibpkey_record.h | ||
ibpkeys.h | ||
iface_record.h | ||
interfaces.h | ||
kernel_to_cil.h | ||
kernel_to_conf.h | ||
module_to_cil.h | ||
module.h | ||
node_record.h | ||
nodes.h | ||
policydb.h | ||
port_record.h | ||
ports.h | ||
sepol.h | ||
user_record.h | ||
users.h |