checkpolicy: Check for mls constraint expression in non-mls policy
PATCH v2 1/1 checkpolicy: Check for mls constraint expression in non-mls policy
In a constraint expression l1, l2, h1, and h2 all refer to levels and should only appear in mls policies.
Return an error if a mls constraint expression is found in a non- mls policy.
Signed-off-by James Carter <[email protected]>
---
v2: Fix typo in commit message.
checkpolicy/policy_define.c | 6 ++++++ 1 file changed, 6 insertions(+)
checkpolicy/policy_define.c +6 -0
@@ -4055,6 +4055,12 @@ uintptr_t define_cexpr(uint32_t expr_type, uintptr_t arg1, uintptr_t arg2) e1->next = expr;return arg1;case CEXPR_ATTR : +if (!mlspol && (arg1 >=CEXPR_L1L2 )) { +yyerror ("MLS constraint expression " +"in non-MLS configuration" ); +constraint_expr_destroy (expr); +return 0 ; + } expr->attr = arg1; expr->op = arg2;return (uintptr_t )expr;
Signature · 1 line
2.55.0
Quoted 8 lines · James Carter
In a constraint expression l1, l2, h1, and h2 all refer to levels and should only appear in mls policies.
Return an error if a mls constraint expression is found in a non- mls policy.
Signed-off-by James Carter <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Stephen Smalley
maintainerQuoted 6 lines · Stephen Smalley
Quoted 4 lines · James Carter
In a constraint expression l1, l2, h1, and h2 all refer to levels and should only appear in mls policies.
Quoted 6 lines
Quoted 4 lines
Return an error if a mls constraint expression is found in a non- mls policy.
Signed-off-by James Carter <[email protected]>Acked-by Stephen Smalley <[email protected]>
Thanks, merged.