Re: [PATCH] pidns: reboot_pid_ns: use SEND_SIG_FORCED instead offorce_sig()

From: Oleg Nesterov
Date: Tue Apr 17 2012 - 14:35:43 EST


On 04/16, Oleg Nesterov wrote:
>
> I'll investigate and report tomorrow.

Thanks again Serge, everything is clear. Afaics this needs another
(almost off-topic) patch.

Please forget about sys_reboot() for the moment. There is a minor
and known problem with SIGKILL && SIGNAL_UNKILLABLE. If you send
SIGKILL from the parent namespace to cinit, this doesn't make it
SIGNAL_GROUP_EXIT immediately. Only after cinit actually dequeues
SIGKILL it does do_group_exit() and set this flag. This should be
fixed anyway, but not now.

And this explain the problem. Note that your test-case does
sys_reboot() from the init process, and reboot_pid_ns() does

kill(pid_ns->child_reaper, SIGKILL);

do_exit(0);

so it sends SIGKILL to itself and exit. This means that cinit
(current) obviously can't dequeue SIGKILL, and without
SIGNAL_GROUP_EXIT wait_task_zombie() ignores
signal->group_exit_code.

That is why the patch makes a difference.

But why reboot_pid_ns() does do_exit? Yes, it was copied from
sys_reboot() and I didn't notice. It should use do_group_exit(),
and sys_reboot() too. This is the patch I am going to send, but
I'll try to think a bit more.

Thanks!

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/