selinux/libsepol/cil
James Carter c071aa2e63 libsepol/cil: Check common perms when verifiying "all"
Commit e81c466 "Fix class permission verification in CIL", added a
check for the use of "all" in a permission expression for a class
that had no permissions. Unfortunately, that change did not take
into account a class that had common permissions, so a class that
has no permmissions of its own, but inherits permissions from a
common, will fail the verification check.

If the class inherits from a common, then add those permissions to
the permmission list when verifying the permission expression.

Example/
(common co1 (cop1))
(class cl1 ())
(classcommon cl1 co1)
(classorder (CLASS cl1))

(classpermission cp1)
(classpermissionset cp1 (cl1 (all)))

(classmap cm1 (cmp1))
(classmapping cm1 cmp1 (cl1 (all)))

Previously, both the classpermissionset and the classmapping rules
would fail verification, but now they pass as expected.

Patch originally from Ben Cressey <bcressey@amazon.com>, I have
expanded the explanation.

Reported-by: Ben Cressey <bcressey@amazon.com>
Signed-off-by: James Carter <jwcart2@gmail.com>
2024-04-04 11:17:40 -04:00
..
include/cil libsepol/cil: Add cil_write_post_ast function 2023-08-16 13:34:09 -04:00
src libsepol/cil: Check common perms when verifiying "all" 2024-04-04 11:17:40 -04:00
test libsepol: Move secilc out of libsepol 2015-03-31 12:31:38 -04:00
.gitignore Merge commit '76ba6eaa7333483a8cc0c73a7880f7acf99c2656' 2015-02-18 09:25:20 -05:00