diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-05-23 22:57:24 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-24 05:14:10 +0200 |
commit | 33e1c288da62a6a5aa9077a6b7bfa690b1b02cf4 (patch) | |
tree | 68837483316db1fa08bcb2b444cabae75d31a5b2 /kernel/fork.c | |
parent | ide serverworks warning fixes (diff) | |
download | linux-33e1c288da62a6a5aa9077a6b7bfa690b1b02cf4.tar.xz linux-33e1c288da62a6a5aa9077a6b7bfa690b1b02cf4.zip |
freezer: close potential race between refrigerator and thaw_tasks
If the freezing of tasks fails and a task is preempted in refrigerator()
before calling frozen_process(), then thaw_tasks() may run before this task is
frozen. In that case the task will freeze and no one will thaw it.
To fix this race we can call freezing(current) in refrigerator() along with
frozen_process(current) under the task_lock() which also should be taken in
the error path of try_to_freeze_tasks() as well as in thaw_process().
Moreover, if thaw_process() additionally clears TIF_FREEZE for tasks that are
not frozen, we can be sure that all tasks are thawed and there are no pending
"freeze" requests after thaw_tasks() has run.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions