Re: [PATCH v2] exec: don't force_sigsegv processes with a pending fatal signal

From: Oleg Nesterov
Date: Mon Feb 11 2019 - 11:03:03 EST


On 02/08, Ivan Delalande wrote:
>
> A difference I've noticed with your tree (unrelated to my issue here but
> that you may want to look at) is when I run my reproducer under
> strace -f, I'm now getting quite a lot of "Exit of unknown pid 12345
> ignored" warnings from strace, which I've never seen with mainline.
> My reproducer simply fork-exec tail processes in a loop, and tries to
> sigkill them in the parent with a variable delay.

Hmm... may be because of PTRACE_EVENT_EXIT problem I mentioned in reply
to this change...

>
> Thank you,
>
> > diff --git a/kernel/signal.c b/kernel/signal.c
> > index 9ca8e5278c8e..5424cb0006bc 100644
> > --- a/kernel/signal.c
> > +++ b/kernel/signal.c
> > @@ -2393,6 +2393,11 @@ bool get_signal(struct ksignal *ksig)
> > goto relock;
> > }
> >
> > + /* Has this task already been marked for death? */
> > + ksig->info.si_signo = signr = SIGKILL;
> > + if (signal_group_exit(signal))
> > + goto fatal;
> > +
> > for (;;) {
> > struct k_sigaction *ka;
> >
> > @@ -2488,6 +2493,7 @@ bool get_signal(struct ksignal *ksig)
> > continue;
> > }
> >
> > + fatal:
> > spin_unlock_irq(&sighand->siglock);
> >
> >
>
> --
> Ivan Delalande
> Arista Networks