checkpolicy/fuzz: Update check_level() to use notdefined field
PATCH 1/1 checkpolicy/fuzz: Update check_level() to use notdefined field
Commit e16f586 (Fix potential double free of mls_level_t) renamed the "defined" field to "notdefined", but did not update this use of it.
Use the new field "notdefined" for the check.
--- checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/fuzz/checkpolicy-fuzzer.c +1 -1
@@ -135,7 +135,7 @@ static int check_level(hashtab_key_t key, hashtab_datum_t datum, void *arg __attconst level_datum_t *levdatum = (level_datum_t *) datum;// TODO: drop member defined if proven to be always set -if (!levdatum->isalias && !levdatum->defined) { +if (!levdatum->isalias && levdatum->notdefined) {fprintf (stderr,"Error: sensitivity %s was not used in a level definition!\n" , key);
Signature · 1 line
2.44.0
Quoted 6 lines · James Carter
Commit e16f586 (Fix potential double free of
mls_level_t) renamed the "defined" field to "notdefined", but did not update this use of it.Use the new field "notdefined" for the check.
Since the renamed member "notdefined" is checked during validation and the fuzzer calls policydb_valudate() I think the whole callback can be removed.
Quoted 21 lines
Signed-off-by James Carter <[email protected]>--- checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)checkpolicy/fuzz/checkpolicy-fuzzer.c +1
-2@@ -135,7 +135,7 @@ static int check_level(hashtab_key_t key, hashtab_datum_t datum, void *arg __attconst level_datum_t *levdatum = (level_datum_t *) datum;// TODO: drop member defined if proven to be always set -if (!levdatum->isalias && !levdatum->defined) { +if (!levdatum->isalias && levdatum->notdefined) {fprintf (stderr,"Error: sensitivity %s was not used in a level definition!\n" , key); --2.44.0
Quoted 7 lines · Christian Göttsche
Quoted 5 lines · James Carter
Commit e16f586 (Fix potential double free of
mls_level_t) renamed the "defined" field to "notdefined", but did not update this use of it.
Quoted 6 lines
Quoted 1 line
Use the new field "notdefined" for the check.
Since the renamed member "notdefined" is checked during validation and the fuzzer calls
policydb_valudate()I think the whole callback can be removed.
I left it in for now because checkpolicy does a similar check and I wanted to get this merged as soon as possible since it was breaking the fuzzer.
Quoted 1 line
Quoted 1 line
Signed-off-by James Carter <[email protected]>
This patch has been merged.
Thanks,
Jim
Quoted 20 lines
Quoted 20 lines
--- checkpolicy/fuzz/checkpolicy-fuzzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)checkpolicy/fuzz/checkpolicy-fuzzer.c +1
-2@@ -135,7 +135,7 @@ static int check_level(hashtab_key_t key, hashtab_datum_t datum, void *arg __attconst level_datum_t *levdatum = (level_datum_t *) datum;// TODO: drop member defined if proven to be always set -if (!levdatum->isalias && !levdatum->defined) { +if (!levdatum->isalias && levdatum->notdefined) {fprintf (stderr,"Error: sensitivity %s was not used in a level definition!\n" , key); --2.44.0