Re: [PATCH] signal: protect SIGNAL_UNKILLABLE from unintentional clearing.

From: Jamie Iles
Date: Mon Nov 28 2016 - 07:15:27 EST


Hi Oleg,

On Thu, Nov 17, 2016 at 08:04:20PM +0100, Oleg Nesterov wrote:
> On 11/16, Jamie Iles wrote:
> >
> > This can result in init becoming stoppable/killable after tracing. For
> > example, running:
> >
> > while true; do kill -STOP 1; done &
> > strace -p 1
>
> > and then stopping strace and the kill loop will result in init being
> > left in state TASK_STOPPED. Sending SIGCONT to init will resume it, but
> > init will now respond to future SIGSTOP signals rather than ignoring
> > them.
>
> Yes, and a lot more... I forgot about these problems again.
>
> Jamie, sorry for delay, I'll try to read the patch and reply tomorrow.

Did you get chance to look at the patch? I did have another thought -
rather than the accessors, we could change signal_struct to have:

unsigned int unkillable:1;
unsigned int flags:31;

to separate signal_unkillable from flags, making it a bit safer in the
future.

Jamie