Skip to content

Commit

Permalink
Revert "libsepol: Make an unknown permission an error in CIL"
Browse files Browse the repository at this point in the history
There are still invalid CILs out in the wild on Android.
Do not throw an error in this case, preserve the old behavior.

This reverts commit dc4e541.
  • Loading branch information
topjohnwu committed Sep 5, 2020
1 parent 1c572c1 commit 969114c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libsepol/cil/src/cil_resolve_ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab,
}
}
if (rc != SEPOL_OK) {
struct cil_list *empty_list;
if (class_flavor == CIL_MAP_CLASS) {
cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data);
} else {
cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data);
goto exit;
}
goto exit;
cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data);
/* Use an empty list to represent unknown perm */
cil_list_init(&empty_list, perm_strs->flavor);
cil_list_append(*perm_datums, CIL_LIST, empty_list);
} else {
cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
}
cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
} else {
cil_list_append(*perm_datums, curr->flavor, curr->data);
}
Expand Down

0 comments on commit 969114c

Please sign in to comment.