Blame SOURCES/0019-libsepol-cil-Destroy-classperm-list-when-resetting-m.patch

71cd55
From 2d35fcc7e9e976a2346b1de20e54f8663e8a6cba Mon Sep 17 00:00:00 2001
71cd55
From: James Carter <jwcart2@gmail.com>
71cd55
Date: Thu, 8 Apr 2021 13:32:04 -0400
71cd55
Subject: [PATCH] libsepol/cil: Destroy classperm list when resetting map perms
71cd55
71cd55
Map perms share the same struct as regular perms, but only the
71cd55
map perms use the classperms field. This field is a pointer to a
71cd55
list of classperms that is created and added to when resolving
71cd55
classmapping rules, so the map permission doesn't own any of the
71cd55
data in the list and this list should be destroyed when the AST is
71cd55
reset.
71cd55
71cd55
When resetting a perm, destroy the classperms list without destroying
71cd55
the data in the list.
71cd55
71cd55
Signed-off-by: James Carter <jwcart2@gmail.com>
71cd55
---
71cd55
 libsepol/cil/src/cil_reset_ast.c | 2 +-
71cd55
 1 file changed, 1 insertion(+), 1 deletion(-)
71cd55
71cd55
diff --git a/libsepol/cil/src/cil_reset_ast.c b/libsepol/cil/src/cil_reset_ast.c
71cd55
index db70a535bd42..89f91e568d0e 100644
71cd55
--- a/libsepol/cil/src/cil_reset_ast.c
71cd55
+++ b/libsepol/cil/src/cil_reset_ast.c
71cd55
@@ -36,7 +36,7 @@ static void cil_reset_class(struct cil_class *class)
71cd55
 
71cd55
 static void cil_reset_perm(struct cil_perm *perm)
71cd55
 {
71cd55
-	cil_reset_classperms_list(perm->classperms);
71cd55
+	cil_list_destroy(&perm->classperms, CIL_FALSE);
71cd55
 }
71cd55
 
71cd55
 static inline void cil_reset_classperms(struct cil_classperms *cp)
71cd55
-- 
71cd55
2.32.0
71cd55