Commit 1be53963b0519bd3681749a9bed8b83aeb005cca
Committed by
Linus Torvalds
1 parent
ad09750b51
Exists in
master
and in
7 other branches
signals: check ->group_stop_count after tracehook_get_signal()
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>
Showing 1 changed file with 4 additions and 5 deletions Side-by-side Diff
kernel/signal.c
... | ... | @@ -1840,11 +1840,6 @@ |
1840 | 1840 | |
1841 | 1841 | for (;;) { |
1842 | 1842 | struct k_sigaction *ka; |
1843 | - | |
1844 | - if (unlikely(signal->group_stop_count > 0) && | |
1845 | - do_signal_stop(0)) | |
1846 | - goto relock; | |
1847 | - | |
1848 | 1843 | /* |
1849 | 1844 | * Tracing can induce an artifical signal and choose sigaction. |
1850 | 1845 | * The return value in @signr determines the default action, |
... | ... | @@ -1856,6 +1851,10 @@ |
1856 | 1851 | if (unlikely(signr != 0)) |
1857 | 1852 | ka = return_ka; |
1858 | 1853 | else { |
1854 | + if (unlikely(signal->group_stop_count > 0) && | |
1855 | + do_signal_stop(0)) | |
1856 | + goto relock; | |
1857 | + | |
1859 | 1858 | signr = dequeue_signal(current, ¤t->blocked, |
1860 | 1859 | info); |
1861 | 1860 |