selinux/policycoreutils
Steve Lawrence 3904db5ac9 policycoreutils: pp: mimic require block support in CIL
CIL does not have any concept of require blocks. Instead, CIL relies on
whether or not all statements inside an optional block resolve to
determine if an optional block should be enabled/disabled. However, a
small number of optional statements require a type that is not actually
used in the optional block. In old style policy, this would cause the
optional block to be disabled. However, in CIL, because the type is never
used, the optional block will remain enabled.

To maintain compatibility, we modify pp2cil to create a new attribute,
cil_gen_require, and all types/roles/attributes that are required in a
pp module/optional block are associated with this attribute. Thus, if a
type is required but not used, it will still fail to resolve in the
typeattributeset statement, causing the optional to correctly be
disabled.

Note that when compiling the CIL this generated from compiling refpolicy
pp modules with pp2cil, the extra CIL statements cause ~12.6MB increase
in maximum memory usage (129.7 MB to 142.3 MB). Though, compilation time
decreases by ~35% (26 seconds to 17 seconds).

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
Reviewed-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com>
Reported-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-11-12 08:06:41 -05:00
..
.tx Update Translations 2013-10-24 13:58:39 -04:00
audit2allow Use $(PYTHON) instead of "python" in every Makefile 2014-10-02 09:56:49 -04:00
gui Fix up desktop files to match current standards 2013-11-08 15:50:59 -05:00
hll policycoreutils: pp: mimic require block support in CIL 2014-11-12 08:06:41 -05:00
load_policy Minor manpages improvements 2013-11-06 09:36:33 -05:00
man Merge branch 'fedora' into master-merge 2013-10-24 15:24:17 -04:00
mcstrans policycoreutils: mcstrans: use string_to_av_perm() to calculate permission access vector 2014-08-29 09:19:50 -04:00
newrole Fix gcc -Wstrict-prototypes warnings 2014-10-02 09:56:38 -04:00
po Update Translations 2013-10-24 13:58:39 -04:00
restorecond Fix gcc -Wstrict-prototypes warnings 2014-10-02 09:56:38 -04:00
run_init Fix gcc -Wstrict-prototypes warnings 2014-10-02 09:56:38 -04:00
sandbox Use $(PYTHON) instead of "python" in every Makefile 2014-10-02 09:56:49 -04:00
scripts Minor manpages improvements 2013-11-06 09:36:33 -05:00
secon Minor manpages improvements 2013-11-06 09:36:33 -05:00
semanage Use $(PYTHON) instead of "python" in every Makefile 2014-10-02 09:56:49 -04:00
semodule policycoreutils: add semodule option to set store root path 2014-08-26 08:03:31 -04:00
semodule_deps Laurent Bigonville patch to fix various minor manpage issues and correct section numbering. 2013-10-24 13:58:37 -04:00
semodule_expand tree: Makefiles: syntax, convert all ${VAR} to $(VAR) 2011-11-02 15:37:08 -04:00
semodule_link tree: Makefiles: syntax, convert all ${VAR} to $(VAR) 2011-11-02 15:37:08 -04:00
semodule_package policycoreutils: fix most gcc -Wwrite-strings warnings 2014-10-02 09:56:34 -04:00
sepolgen-ifgen tree: Makefiles: syntax, convert all ${VAR} to $(VAR) 2011-11-02 15:37:08 -04:00
sepolicy Use $(PYTHON) instead of "python" in every Makefile 2014-10-02 09:56:49 -04:00
sestatus Laurent Bigonville patch to fix various minor manpage issues and correct section numbering. 2013-10-24 13:58:37 -04:00
setfiles Fix gcc -Wstrict-prototypes warnings 2014-10-02 09:56:38 -04:00
setsebool Cleanup whitespace 2013-11-08 15:52:11 -05:00
.gitignore policycoreutils: add a HLL compiler to convert policy packages (.pp) to CIL 2014-08-26 08:03:31 -04:00
ChangeLog Bump to release candidate 5 2014-10-29 11:01:03 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile policycoreutils: add a HLL compiler to convert policy packages (.pp) to CIL 2014-08-26 08:03:31 -04:00
VERSION Bump to release candidate 5 2014-10-29 11:01:03 -04:00