diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-05-05 11:18:15 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-05 23:19:18 -0400 |
commit | 292823814261e085cdcef06b6b691e6c2563fbd4 (patch) | |
tree | 8c1eaebcf8f698ea13ac2a9291b9769abde1905e /security/tomoyo/gc.c | |
parent | 2b9e4688fad8867b6e918610f396af3ab9246898 (diff) |
TOMOYO: Use mutex_lock_interruptible.
Some of TOMOYO's functions may sleep after mutex_lock(). If OOM-killer selected
a process which is waiting at mutex_lock(), the to-be-killed process can't be
killed. Thus, replace mutex_lock() with mutex_lock_interruptible() so that the
to-be-killed process can immediately return from TOMOYO's functions.
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/gc.c')
-rw-r--r-- | security/tomoyo/gc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c index d9ad35bc7fa8..245bf422e3a5 100644 --- a/security/tomoyo/gc.c +++ b/security/tomoyo/gc.c | |||
@@ -151,7 +151,8 @@ static void tomoyo_del_name(const struct tomoyo_name_entry *ptr) | |||
151 | 151 | ||
152 | static void tomoyo_collect_entry(void) | 152 | static void tomoyo_collect_entry(void) |
153 | { | 153 | { |
154 | mutex_lock(&tomoyo_policy_lock); | 154 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) |
155 | return; | ||
155 | { | 156 | { |
156 | struct tomoyo_globally_readable_file_entry *ptr; | 157 | struct tomoyo_globally_readable_file_entry *ptr; |
157 | list_for_each_entry_rcu(ptr, &tomoyo_globally_readable_list, | 158 | list_for_each_entry_rcu(ptr, &tomoyo_globally_readable_list, |
@@ -275,8 +276,6 @@ static void tomoyo_collect_entry(void) | |||
275 | break; | 276 | break; |
276 | } | 277 | } |
277 | } | 278 | } |
278 | mutex_unlock(&tomoyo_policy_lock); | ||
279 | mutex_lock(&tomoyo_name_list_lock); | ||
280 | { | 279 | { |
281 | int i; | 280 | int i; |
282 | for (i = 0; i < TOMOYO_MAX_HASH; i++) { | 281 | for (i = 0; i < TOMOYO_MAX_HASH; i++) { |
@@ -294,7 +293,7 @@ static void tomoyo_collect_entry(void) | |||
294 | } | 293 | } |
295 | } | 294 | } |
296 | } | 295 | } |
297 | mutex_unlock(&tomoyo_name_list_lock); | 296 | mutex_unlock(&tomoyo_policy_lock); |
298 | } | 297 | } |
299 | 298 | ||
300 | static void tomoyo_kfree_entry(void) | 299 | static void tomoyo_kfree_entry(void) |