aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/gc.c')
-rw-r--r--security/tomoyo/gc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c
index de14030823cd..412ee8309c23 100644
--- a/security/tomoyo/gc.c
+++ b/security/tomoyo/gc.c
@@ -265,10 +265,17 @@ static bool tomoyo_collect_member(const enum tomoyo_policy_id id,
265 return true; 265 return true;
266} 266}
267 267
268static bool tomoyo_collect_acl(struct tomoyo_domain_info *domain) 268/**
269 * tomoyo_collect_acl - Delete elements in "struct tomoyo_domain_info".
270 *
271 * @list: Pointer to "struct list_head".
272 *
273 * Returns true if some elements are deleted, false otherwise.
274 */
275static bool tomoyo_collect_acl(struct list_head *list)
269{ 276{
270 struct tomoyo_acl_info *acl; 277 struct tomoyo_acl_info *acl;
271 list_for_each_entry(acl, &domain->acl_info_list, list) { 278 list_for_each_entry(acl, list, list) {
272 if (!acl->is_deleted) 279 if (!acl->is_deleted)
273 continue; 280 continue;
274 if (!tomoyo_add_to_gc(TOMOYO_ID_ACL, &acl->list)) 281 if (!tomoyo_add_to_gc(TOMOYO_ID_ACL, &acl->list))
@@ -291,10 +298,13 @@ static void tomoyo_collect_entry(void)
291 if (!tomoyo_collect_member(i, &tomoyo_policy_list[i])) 298 if (!tomoyo_collect_member(i, &tomoyo_policy_list[i]))
292 goto unlock; 299 goto unlock;
293 } 300 }
301 for (i = 0; i < TOMOYO_MAX_ACL_GROUPS; i++)
302 if (!tomoyo_collect_acl(&tomoyo_acl_group[i]))
303 goto unlock;
294 { 304 {
295 struct tomoyo_domain_info *domain; 305 struct tomoyo_domain_info *domain;
296 list_for_each_entry_rcu(domain, &tomoyo_domain_list, list) { 306 list_for_each_entry_rcu(domain, &tomoyo_domain_list, list) {
297 if (!tomoyo_collect_acl(domain)) 307 if (!tomoyo_collect_acl(&domain->acl_info_list))
298 goto unlock; 308 goto unlock;
299 if (!domain->is_deleted || atomic_read(&domain->users)) 309 if (!domain->is_deleted || atomic_read(&domain->users))
300 continue; 310 continue;