kernel-hacking-2024-linux-s.../kernel/power
Tejun Heo 8cfe400ca5 Freezer: Fix a race during freezing of TASK_STOPPED tasks
After calling freeze_task(), try_to_freeze_tasks() see whether the
task is stopped or traced and if so, considers it to be frozen;
however, nothing guarantees that either the task being frozen sees
TIF_FREEZE or the freezer sees TASK_STOPPED -> TASK_RUNNING
transition.  The task being frozen may wake up and not see TIF_FREEZE
while the freezer fails to notice the transition and believes the task
is still stopped.

This patch fixes the race by making freeze_task() always go through
fake_signal_wake_up() for applicable tasks.  The function goes through
the target task's scheduler lock and thus guarantees that either the
target sees TIF_FREEZE or try_to_freeze_task() sees TASK_RUNNING.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-12-24 15:02:40 +01:00
..
block_io.c
console.c
hibernate.c PM / Hibernate: Fix memory corruption related to swap 2010-12-06 23:52:08 +01:00
Kconfig PM / OPP: Hide OPP configuration when SoCs do not provide an implementation 2010-11-11 01:51:26 +01:00
main.c PM: Add sysfs attr for rechecking dev hash from PM trace 2010-10-17 01:57:50 +02:00
Makefile PM: Use proper ccflag flag in kernel/power/Makefile 2010-12-24 15:02:40 +01:00
nvs.c
power.h PM / Hibernate: Make default image size depend on total RAM size 2010-10-17 01:57:43 +02:00
poweroff.c
process.c Freezer: Fix a race during freezing of TASK_STOPPED tasks 2010-12-24 15:02:40 +01:00
snapshot.c use clear_page()/copy_page() in favor of memset()/memcpy() on whole pages 2010-10-26 16:52:13 -07:00
suspend.c PM / Hibernate: Fix memory corruption related to swap 2010-12-06 23:52:08 +01:00
suspend_test.c
swap.c PM / Hibernate: Restore old swap signature to avoid user space breakage 2010-12-16 17:08:58 +01:00
user.c PM / Hibernate: Fix PM_POST_* notification with user-space suspend 2010-12-16 17:08:43 +01:00