libsepol: validate empty common classes in scope indices
PATCH 1/1 libsepol: validate empty common classes in scope indices
Validate no common classes inside scope indices are defined.
---
This probably also resolves issue 64854, which I could not reproduce locally.
Supersedes https://patchwork.kernel.org/project/selinux/patch/[email protected]/
--- libsepol/src/policydb_validate.c | 2 ++ 1 file changed, 2 insertions(+)
libsepol/src/policydb_validate.c +2 -0
@@ -1344,6 +1344,8 @@ bad:static int validate_scope_index (sepol_handle_t *handle,const scope_index_t *scope_index,validate_t flavors[]) { +if (!ebitmap_is_empty (&scope_index->scope[SYM_COMMONS ])) + goto bad;if (validate_ebitmap (&scope_index->p_classes_scope, &flavors[SYM_CLASSES ])) goto bad;if (validate_ebitmap (&scope_index->p_roles_scope, &flavors[SYM_ROLES ]))
Signature · 1 line
2.43.0
Quoted 5 lines · Christian Göttsche
Validate no common classes inside scope indices are defined.
Reported-by oss-fuzz (issue 64849)Signed-off-by Christian Göttsche <[email protected]>
Quoted 26 lines
---
This probably also resolves issue 64854, which I could not reproduce locally.Supersedes https://patchwork.kernel.org/project/selinux/patch/[email protected]/
--- libsepol/src/policydb_validate.c | 2 ++ 1 file changed, 2 insertions(+)libsepol/src/policydb_validate.c +2
-1@@ -1344,6 +1344,8 @@ bad:static int validate_scope_index (sepol_handle_t *handle,const scope_index_t *scope_index,validate_t flavors[]) { +if (!ebitmap_is_empty (&scope_index->scope[SYM_COMMONS ])) + goto bad;if (validate_ebitmap (&scope_index->p_classes_scope, &flavors[SYM_CLASSES ])) goto bad;if (validate_ebitmap (&scope_index->p_roles_scope, &flavors[SYM_ROLES ])) --2.43.0
Quoted 11 lines · James Carter
Quoted 5 lines · Christian Göttsche
Validate no common classes inside scope indices are defined.
Reported-by oss-fuzz (issue 64849)Signed-off-by Christian Göttsche <[email protected]>Acked-by James Carter <[email protected]>
Merged.
Thanks,
Jim
Quoted 26 lines
Quoted 26 lines
---
This probably also resolves issue 64854, which I could not reproduce locally.Supersedes https://patchwork.kernel.org/project/selinux/patch/[email protected]/
--- libsepol/src/policydb_validate.c | 2 ++ 1 file changed, 2 insertions(+)libsepol/src/policydb_validate.c +2
-1@@ -1344,6 +1344,8 @@ bad:static int validate_scope_index (sepol_handle_t *handle,const scope_index_t *scope_index,validate_t flavors[]) { +if (!ebitmap_is_empty (&scope_index->scope[SYM_COMMONS ])) + goto bad;if (validate_ebitmap (&scope_index->p_classes_scope, &flavors[SYM_CLASSES ])) goto bad;if (validate_ebitmap (&scope_index->p_roles_scope, &flavors[SYM_ROLES ])) --2.43.0