Re: [PATCH] kernel/exit: do panic earlier to get coredump if global init task exit
From: Oleg Nesterov
Date: Thu Dec 12 2019 - 04:51:37 EST
On 12/12, qiwuchen55@xxxxxxxxx wrote:
>
> Of course testing signal_group_exit() is not sufficient. It is still
> possible that this is someone calling exit(2)
Or execve(), so
> @@ -785,6 +781,9 @@ void __noreturn do_exit(long code)
> panic("Aiee, killing interrupt handler!");
> if (unlikely(!tsk->pid))
> panic("Attempted to kill the idle task!");
> + if (unlikely(is_global_init(tsk) &&
> + (signal_group_exit(tsk->signal) || thread_group_empty(tsk))))
> + panic("Attempted to kill init! exitcode=0x%08lx\n", code);
so this can panic() if one of init's threads does does exec.
Oleg.