* [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
@ 2011-09-26 17:06 Oleg Nesterov
2011-09-26 17:07 ` Oleg Nesterov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Oleg Nesterov @ 2011-09-26 17:06 UTC (permalink / raw)
To: Greg KH; +Cc: Tejun Heo, Luke Macken, stable, linux-kernel
https://bugzilla.redhat.com/show_bug.cgi?id=740121
1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
in do_signal_stop().
This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
unconditionally but doesn't update it if task_is_stopped().
2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
not right, a stopped-but-resumed tracee can clone the untraced
thread in the SIGNAL_STOP_STOPPED group, the new thread can start
another group-stop.
Remove this warning, we need more fixes to make it true.
Reported-by: Luke Macken <lmacken@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
--- 3.0/kernel/signal.c
+++ 3.0/kernel/signal.c
@@ -1894,21 +1894,19 @@ static int do_signal_stop(int signr)
*/
if (!(sig->flags & SIGNAL_STOP_STOPPED))
sig->group_exit_code = signr;
- else
- WARN_ON_ONCE(!task_ptrace(current));
current->group_stop &= ~GROUP_STOP_SIGMASK;
current->group_stop |= signr | gstop;
sig->group_stop_count = 1;
for (t = next_thread(current); t != current;
t = next_thread(t)) {
- t->group_stop &= ~GROUP_STOP_SIGMASK;
/*
* Setting state to TASK_STOPPED for a group
* stop is always done with the siglock held,
* so this check has no races.
*/
if (!(t->flags & PF_EXITING) && !task_is_stopped(t)) {
+ t->group_stop &= ~GROUP_STOP_SIGMASK;
t->group_stop |= signr | gstop;
sig->group_stop_count++;
signal_wake_up(t, 0);
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
2011-09-26 17:06 [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop Oleg Nesterov
@ 2011-09-26 17:07 ` Oleg Nesterov
2011-09-26 22:15 ` Greg KH
2011-10-19 23:00 ` Greg KH
2 siblings, 0 replies; 6+ messages in thread
From: Oleg Nesterov @ 2011-09-26 17:07 UTC (permalink / raw)
To: Greg KH; +Cc: Tejun Heo, Luke Macken, stable, linux-kernel
On 09/26, Oleg Nesterov wrote:
>
> 1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
> in do_signal_stop().
>
> This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
> unconditionally but doesn't update it if task_is_stopped().
>
> 2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
> not right, a stopped-but-resumed tracee can clone the untraced
> thread in the SIGNAL_STOP_STOPPED group, the new thread can start
> another group-stop.
>
> Remove this warning, we need more fixes to make it true.
Tejun, 3.1 has similar problems. I'll write another email...
Oleg.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
2011-09-26 17:06 [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop Oleg Nesterov
2011-09-26 17:07 ` Oleg Nesterov
@ 2011-09-26 22:15 ` Greg KH
2011-09-27 12:54 ` Oleg Nesterov
2011-10-19 23:00 ` Greg KH
2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-09-26 22:15 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Tejun Heo, Luke Macken, stable, linux-kernel
On Mon, Sep 26, 2011 at 07:06:32PM +0200, Oleg Nesterov wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=740121
>
> 1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
> in do_signal_stop().
>
> This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
> unconditionally but doesn't update it if task_is_stopped().
>
> 2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
> not right, a stopped-but-resumed tracee can clone the untraced
> thread in the SIGNAL_STOP_STOPPED group, the new thread can start
> another group-stop.
>
> Remove this warning, we need more fixes to make it true.
>
> Reported-by: Luke Macken <lmacken@redhat.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Is this fix in Linus's tree already? If so, what's the git commit id?
If not, please take a look at Documentation/stable_kernel_rules.txt for
how to properly submit a patch to the stable tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
2011-09-26 22:15 ` Greg KH
@ 2011-09-27 12:54 ` Oleg Nesterov
0 siblings, 0 replies; 6+ messages in thread
From: Oleg Nesterov @ 2011-09-27 12:54 UTC (permalink / raw)
To: Greg KH; +Cc: Tejun Heo, Luke Macken, stable, linux-kernel
On 09/26, Greg KH wrote:
>
> On Mon, Sep 26, 2011 at 07:06:32PM +0200, Oleg Nesterov wrote:
> > https://bugzilla.redhat.com/show_bug.cgi?id=740121
> >
> > 1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
> > in do_signal_stop().
> >
> > This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
> > unconditionally but doesn't update it if task_is_stopped().
> >
> > 2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
> > not right, a stopped-but-resumed tracee can clone the untraced
> > thread in the SIGNAL_STOP_STOPPED group, the new thread can start
> > another group-stop.
> >
> > Remove this warning, we need more fixes to make it true.
> >
> > Reported-by: Luke Macken <lmacken@redhat.com>
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> Is this fix in Linus's tree already? If so, what's the git commit id?
No. As I said, 3.1 has the similar problem. But not the same, and you
need the quite different test-case to trigger the bug.
We are discussing the possible fixes for 3.1, but this code was changed
very much and it doesn't make sense to compare the fixes for 3.1 and 3.0.
Oleg.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
2011-09-26 17:06 [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop Oleg Nesterov
2011-09-26 17:07 ` Oleg Nesterov
2011-09-26 22:15 ` Greg KH
@ 2011-10-19 23:00 ` Greg KH
2011-10-20 14:47 ` Oleg Nesterov
2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-10-19 23:00 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Greg KH, Tejun Heo, Luke Macken, stable, linux-kernel
On Mon, Sep 26, 2011 at 07:06:32PM +0200, Oleg Nesterov wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=740121
>
> 1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
> in do_signal_stop().
>
> This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
> unconditionally but doesn't update it if task_is_stopped().
>
> 2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
> not right, a stopped-but-resumed tracee can clone the untraced
> thread in the SIGNAL_STOP_STOPPED group, the new thread can start
> another group-stop.
>
> Remove this warning, we need more fixes to make it true.
>
> Reported-by: Luke Macken <lmacken@redhat.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
I still don't understand, did this fix ever get into Linus's tree? If
so, what is the git commit id.
If not, why not? I can't apply it to the 3.0-stable tree unless it is
there, or there is a very good reason why it isn't.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop
2011-10-19 23:00 ` Greg KH
@ 2011-10-20 14:47 ` Oleg Nesterov
0 siblings, 0 replies; 6+ messages in thread
From: Oleg Nesterov @ 2011-10-20 14:47 UTC (permalink / raw)
To: Greg KH; +Cc: Greg KH, Tejun Heo, Luke Macken, stable, linux-kernel
On 10/19, Greg KH wrote:
>
> On Mon, Sep 26, 2011 at 07:06:32PM +0200, Oleg Nesterov wrote:
> > https://bugzilla.redhat.com/show_bug.cgi?id=740121
> >
> > 1. Luke Macken triggered WARN_ON(!(group_stop & GROUP_STOP_SIGMASK))
> > in do_signal_stop().
> >
> > This is because do_signal_stop() clears GROUP_STOP_SIGMASK part
> > unconditionally but doesn't update it if task_is_stopped().
> >
> > 2. Looking at this problem I noticed that WARN_ON_ONCE(!ptrace) is
> > not right, a stopped-but-resumed tracee can clone the untraced
> > thread in the SIGNAL_STOP_STOPPED group, the new thread can start
> > another group-stop.
> >
> > Remove this warning, we need more fixes to make it true.
> >
> > Reported-by: Luke Macken <lmacken@redhat.com>
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> I still don't understand, did this fix ever get into Linus's tree? If
> so, what is the git commit id.
>
> If not, why not?
I already explained:
No. As I said, 3.1 has the similar problem. But not the same, and you
need the quite different test-case to trigger the bug.
We are discussing the possible fixes for 3.1, but this code was changed
very much and it doesn't make sense to compare the fixes for 3.1 and 3.0.
IOW. This code was rewritten in 3.1, this particlular problem
was "fixed" by accident, but in fact the problem just mutated.
> I can't apply it to the 3.0-stable tree unless it is
> there, or there is a very good reason why it isn't.
OK, please ignore then.
Oleg.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-20 14:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 17:06 [PATCH stable-3.0] ptrace: don't clear GROUP_STOP_SIGMASK on double-stop Oleg Nesterov
2011-09-26 17:07 ` Oleg Nesterov
2011-09-26 22:15 ` Greg KH
2011-09-27 12:54 ` Oleg Nesterov
2011-10-19 23:00 ` Greg KH
2011-10-20 14:47 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).