diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2011-09-25 04:50:23 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-09-25 20:46:20 -0400 |
commit | f9732ea145886786a6f8b0493bc2239e70cbacdb (patch) | |
tree | e29b2441cc916a174d7cd0b03cd18986ae545250 /security/tomoyo/domain.c | |
parent | 778c4a4d60d932c1df6d270dcbc88365823c3963 (diff) |
TOMOYO: Simplify garbage collector.
When TOMOYO started using garbage collector at commit 847b173e "TOMOYO: Add
garbage collector.", we waited for close() before kfree(). Thus, elements to be
kfree()d were queued up using tomoyo_gc_list list.
But it turned out that tomoyo_element_linked_by_gc() tends to choke garbage
collector when certain pattern of entries are queued.
Since garbage collector is no longer waiting for close() since commit 2e503bbb
"TOMOYO: Fix lockdep warning.", we can remove tomoyo_gc_list list and
tomoyo_element_linked_by_gc() by doing sequential processing.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/domain.c')
-rw-r--r-- | security/tomoyo/domain.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 70acf7aebbda..da16dfeed728 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c | |||
@@ -39,6 +39,8 @@ int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size, | |||
39 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) | 39 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) |
40 | return -ENOMEM; | 40 | return -ENOMEM; |
41 | list_for_each_entry_rcu(entry, list, list) { | 41 | list_for_each_entry_rcu(entry, list, list) { |
42 | if (entry->is_deleted == TOMOYO_GC_IN_PROGRESS) | ||
43 | continue; | ||
42 | if (!check_duplicate(entry, new_entry)) | 44 | if (!check_duplicate(entry, new_entry)) |
43 | continue; | 45 | continue; |
44 | entry->is_deleted = param->is_delete; | 46 | entry->is_deleted = param->is_delete; |
@@ -115,6 +117,8 @@ int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size, | |||
115 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) | 117 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) |
116 | goto out; | 118 | goto out; |
117 | list_for_each_entry_rcu(entry, list, list) { | 119 | list_for_each_entry_rcu(entry, list, list) { |
120 | if (entry->is_deleted == TOMOYO_GC_IN_PROGRESS) | ||
121 | continue; | ||
118 | if (!tomoyo_same_acl_head(entry, new_entry) || | 122 | if (!tomoyo_same_acl_head(entry, new_entry) || |
119 | !check_duplicate(entry, new_entry)) | 123 | !check_duplicate(entry, new_entry)) |
120 | continue; | 124 | continue; |