libsepol: validate: check low category is not bigger than high

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2023-05-12 11:29:59 +02:00 committed by James Carter
parent 4cf37608b5
commit ac015a3996

View File

@ -545,6 +545,8 @@ static int validate_mls_semantic_cat(const mls_semantic_cat_t *cat, const valida
goto bad;
if (validate_value(cat->high, cats))
goto bad;
if (cat->low > cat->high)
goto bad;
}
return 0;