The patch titled Subject: signals: avoid random wakeups in sigsuspend() has been added to the -mm tree. Its filename is signals-work-around-random-wakeups-in-sigsuspend.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/signals-work-around-random-wakeups-in-sigsuspend.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/signals-work-around-random-wakeups-in-sigsuspend.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Sasha Levin <sasha.levin@xxxxxxxxxx> Subject: signals: avoid random wakeups in sigsuspend() A random wakeup can get us out of sigsuspend() without TIF_SIGPENDING being set. Avoid that by making sure we were signaled, like sys_pause() does. Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx> Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx> Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/signal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff -puN kernel/signal.c~signals-work-around-random-wakeups-in-sigsuspend kernel/signal.c --- a/kernel/signal.c~signals-work-around-random-wakeups-in-sigsuspend +++ a/kernel/signal.c @@ -3508,8 +3508,10 @@ static int sigsuspend(sigset_t *set) current->saved_sigmask = current->blocked; set_current_blocked(set); - __set_current_state(TASK_INTERRUPTIBLE); - schedule(); + while (!signal_pending(current)) { + __set_current_state(TASK_INTERRUPTIBLE); + schedule(); + } set_restore_sigmask(); return -ERESTARTNOHAND; } _ Patches currently in -mm which might be from sasha.levin@xxxxxxxxxx are signals-work-around-random-wakeups-in-sigsuspend.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html