checkpolicy: Check for mls constraint expression in non-mls policy
PATCH 1/1 checkpolicy: Check for mls constraint expression in non-mls policy
In a constraint expresison 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]>
--- 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