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