libsepol/cil: Initialize the multiple_decls field of the cil db
PATCH 1/1 libsepol/cil: Initialize the multiple_decls field of the cil db
Initialize the multiple_decls field when intializing the structure cil_db.
Issue reported by: Topi Miettinen <[email protected]>
types[attributes]")
--- libsepol/cil/src/cil.c | 1 + 1 file changed, 1 insertion(+)
libsepol/cil/src/cil.c +1 -0
@@ -459,6 +459,7 @@ void cil_db_init(struct cil_db **db) (*db)->preserve_tunables =CIL_FALSE ; (*db)->handle_unknown =-1 ; (*db)->mls =-1 ; + (*db)->multiple_decls =CIL_FALSE ; (*db)->target_platform =SEPOL_TARGET_SELINUX ; (*db)->policy_version =POLICYDB_VERSION_MAX ; }
Signature · 1 line
2.25.4
Stephen Smalley
maintainerQuoted 8 lines · James Carter
Initialize the
multiple_declsfield when intializing the structurecil_db.Issue reported by: Topi Miettinen <[email protected]>
Fixes fafe4c212bf6c32c ("libsepol: cil: Add ability to redeclaretypes[attributes]")
I guess this explains the non-deterministic behavior and valgrind warning about uninitialized data, but what about the segfault? Don't we still need to fix the case when multiple_decls is set to TRUE?
Quoted 20 lines
Signed-off-by James Carter <[email protected]>--- libsepol/cil/src/cil.c | 1 + 1 file changed, 1 insertion(+)libsepol/cil/src/cil.c +1
-1@@ -459,6 +459,7 @@ void cil_db_init(struct cil_db **db) (*db)->preserve_tunables =CIL_FALSE ; (*db)->handle_unknown =-1 ; (*db)->mls =-1 ; + (*db)->multiple_decls =CIL_FALSE ; (*db)->target_platform =SEPOL_TARGET_SELINUX ; (*db)->policy_version =POLICYDB_VERSION_MAX ; } --2.25.4
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · James Carter
Initialize the
multiple_declsfield when intializing the structurecil_db.
Quoted 8 lines
Quoted 4 lines
Issue reported by: Topi Miettinen <[email protected]>
Fixes fafe4c212bf6c32c ("libsepol: cil: Add ability to redeclaretypes[attributes]")
I guess this explains the non-deterministic behavior and valgrind warning about uninitialized data, but what about the segfault? Don't we still need to fix the case when
multiple_declsis set to TRUE?
Yes. I am working on that. I believe the segfault occurs when you declare something both a type and a typeattribute.
Jim
Quoted 21 lines
Quoted 21 lines
Signed-off-by James Carter <[email protected]>--- libsepol/cil/src/cil.c | 1 + 1 file changed, 1 insertion(+)libsepol/cil/src/cil.c +1
-1@@ -459,6 +459,7 @@ void cil_db_init(struct cil_db **db) (*db)->preserve_tunables =CIL_FALSE ; (*db)->handle_unknown =-1 ; (*db)->mls =-1 ; + (*db)->multiple_decls =CIL_FALSE ; (*db)->target_platform =SEPOL_TARGET_SELINUX ; (*db)->policy_version =POLICYDB_VERSION_MAX ; } --2.25.4