Skip to content

Commit

Permalink
signals: check ->group_stop_count after tracehook_get_signal()
Browse files Browse the repository at this point in the history
Move the call to do_signal_stop() down, after tracehook call.  This makes
->group_stop_count condition visible to tracers before do_signal_stop()
will participate in this group-stop.

Currently the patch has no effect, tracehook_get_signal() always returns 0.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Dec 16, 2009
1 parent ad09750 commit 1be5396
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,11 +1840,6 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,

for (;;) {
struct k_sigaction *ka;

if (unlikely(signal->group_stop_count > 0) &&
do_signal_stop(0))
goto relock;

/*
* Tracing can induce an artifical signal and choose sigaction.
* The return value in @signr determines the default action,
Expand All @@ -1856,6 +1851,10 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
if (unlikely(signr != 0))
ka = return_ka;
else {
if (unlikely(signal->group_stop_count > 0) &&
do_signal_stop(0))
goto relock;

signr = dequeue_signal(current, &current->blocked,
info);

Expand Down

0 comments on commit 1be5396

Please sign in to comment.