Skip to content

Commit 1efc121

Browse files
committed
libsepol: Do not reject all type rules in conditionals when validating
Commit 1c91bc8 ("libsepol: reject self flag in type rules in old policies") actually rejects all type rules in conditionals in modular policies prior to version 21 (MOD_POLICYDB_VERSION_SELF_TYPETRANS). The problem is because of fall-through in a switch statement when the avrule flags are 0. Instead, break rather than fall-through when avrule flags are 0. Reviewed-by: Christian Göttsche <[email protected]> Acked-by: Petr Lautrbach <[email protected]>
1 parent e6c99f3 commit 1efc121

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libsepol/src/policydb_validate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ static int validate_avrules(sepol_handle_t *handle, const avrule_t *avrule, int
10761076

10771077
switch(avrule->flags) {
10781078
case 0:
1079+
break;
10791080
case RULE_SELF:
10801081
if (p->policyvers != POLICY_KERN &&
10811082
p->policyvers < MOD_POLICYDB_VERSION_SELF_TYPETRANS &&

0 commit comments

Comments
 (0)