diff options
Diffstat (limited to 'security/tomoyo/gc.c')
-rw-r--r-- | security/tomoyo/gc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c index be2d3b935533..8a31f0c628b2 100644 --- a/security/tomoyo/gc.c +++ b/security/tomoyo/gc.c | |||
@@ -18,6 +18,7 @@ enum tomoyo_gc_id { | |||
18 | TOMOYO_ID_NUMBER_GROUP_MEMBER, | 18 | TOMOYO_ID_NUMBER_GROUP_MEMBER, |
19 | TOMOYO_ID_DOMAIN_INITIALIZER, | 19 | TOMOYO_ID_DOMAIN_INITIALIZER, |
20 | TOMOYO_ID_DOMAIN_KEEPER, | 20 | TOMOYO_ID_DOMAIN_KEEPER, |
21 | TOMOYO_ID_AGGREGATOR, | ||
21 | TOMOYO_ID_ALIAS, | 22 | TOMOYO_ID_ALIAS, |
22 | TOMOYO_ID_GLOBALLY_READABLE, | 23 | TOMOYO_ID_GLOBALLY_READABLE, |
23 | TOMOYO_ID_PATTERN, | 24 | TOMOYO_ID_PATTERN, |
@@ -77,6 +78,12 @@ static void tomoyo_del_domain_keeper(struct tomoyo_domain_keeper_entry *ptr) | |||
77 | tomoyo_put_name(ptr->program); | 78 | tomoyo_put_name(ptr->program); |
78 | } | 79 | } |
79 | 80 | ||
81 | static void tomoyo_del_aggregator(struct tomoyo_aggregator_entry *ptr) | ||
82 | { | ||
83 | tomoyo_put_name(ptr->original_name); | ||
84 | tomoyo_put_name(ptr->aggregated_name); | ||
85 | } | ||
86 | |||
80 | static void tomoyo_del_alias(struct tomoyo_alias_entry *ptr) | 87 | static void tomoyo_del_alias(struct tomoyo_alias_entry *ptr) |
81 | { | 88 | { |
82 | tomoyo_put_name(ptr->original_name); | 89 | tomoyo_put_name(ptr->original_name); |
@@ -264,6 +271,17 @@ static void tomoyo_collect_entry(void) | |||
264 | } | 271 | } |
265 | } | 272 | } |
266 | { | 273 | { |
274 | struct tomoyo_aggregator_entry *ptr; | ||
275 | list_for_each_entry_rcu(ptr, &tomoyo_aggregator_list, list) { | ||
276 | if (!ptr->is_deleted) | ||
277 | continue; | ||
278 | if (tomoyo_add_to_gc(TOMOYO_ID_AGGREGATOR, ptr)) | ||
279 | list_del_rcu(&ptr->list); | ||
280 | else | ||
281 | break; | ||
282 | } | ||
283 | } | ||
284 | { | ||
267 | struct tomoyo_alias_entry *ptr; | 285 | struct tomoyo_alias_entry *ptr; |
268 | list_for_each_entry_rcu(ptr, &tomoyo_alias_list, list) { | 286 | list_for_each_entry_rcu(ptr, &tomoyo_alias_list, list) { |
269 | if (!ptr->is_deleted) | 287 | if (!ptr->is_deleted) |
@@ -417,6 +435,9 @@ static void tomoyo_kfree_entry(void) | |||
417 | case TOMOYO_ID_DOMAIN_KEEPER: | 435 | case TOMOYO_ID_DOMAIN_KEEPER: |
418 | tomoyo_del_domain_keeper(p->element); | 436 | tomoyo_del_domain_keeper(p->element); |
419 | break; | 437 | break; |
438 | case TOMOYO_ID_AGGREGATOR: | ||
439 | tomoyo_del_aggregator(p->element); | ||
440 | break; | ||
420 | case TOMOYO_ID_ALIAS: | 441 | case TOMOYO_ID_ALIAS: |
421 | tomoyo_del_alias(p->element); | 442 | tomoyo_del_alias(p->element); |
422 | break; | 443 | break; |