Re: [PATCH] handle_stop_signal: don't wake up the stopped task untilit sees SIGCONT
From: Jiri Kosina
Date: Thu Feb 28 2008 - 11:56:41 EST
On Thu, 28 Feb 2008, Oleg Nesterov wrote:
> -------------------------------------------------------------------------------
> [PATCH] handle_stop_signal: don't wake up the stopped task until it sees SIGCONT
>
> The bug was found by Jiri Kosina <jkosina@xxxxxxx>, and the patch is based
> on his ideas.
> handle_stop_signal(SIGCONT) wakes up the stopped task and unlocks ->siglock
> for do_notify_parent_cldstop(p, CLD_CONTINUED). The woken task returns from
> do_signal_stop(), takes ->siglock and resumes to user-space without actually
> seeing SIGCONT which may have a handler.
> Move the code realated to do_notify_parent_cldstop(CLD_CONTINUED) up, before
> "wake_up_state(t, state)".
> NOTE: It is possible that the subsequent rm_from_queue(SIG_KERNEL_STOP_MASK)
> removes SIGSTOP which comes after SIGCONT when we drop ->siglock. Not nice,
> but possible even without this change. Hopefully we can remove the parent
> notifying code from the sender path completely, but this needs more thinking.
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Acked-by: Jiri Kosina <jkosina@xxxxxxx>
--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/