Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Software suspend and recalc sigpending bug fix

This patch fixes recalc_sigpending() to work correctly with tasks which are
being freezed.

The problem is that freeze_processes() sets PF_FREEZE and TIF_SIGPENDING
flags on tasks, but recalc_sigpending() called from e.g.
sys_rt_sigtimedwait or any other kernel place will clear TIF_SIGPENDING due
to no pending signals queued and the tasks won't be freezed until it
recieves a real signal or freezed_processes() fail due to timeout.

Signed-Off-By: Kirill Korotaev <dev@sw.ru>
Signed-Off-By: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Kirill Korotaev and committed by
Linus Torvalds
4fea2838 af4d2ecb

+1
+1
kernel/signal.c
··· 213 213 fastcall void recalc_sigpending_tsk(struct task_struct *t) 214 214 { 215 215 if (t->signal->group_stop_count > 0 || 216 + (t->flags & PF_FREEZE) || 216 217 PENDING(&t->pending, &t->blocked) || 217 218 PENDING(&t->signal->shared_pending, &t->blocked)) 218 219 set_tsk_thread_flag(t, TIF_SIGPENDING);