[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2019 10:51:28 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: qiwuchen55@...il.com
Cc: peterz@...radead.org, mingo@...nel.org,
christian.brauner@...ntu.com, kernel-team@...roid.com,
linux-kernel@...r.kernel.org, chenqiwu <chenqiwu@...omi.com>
Subject: Re: [PATCH] kernel/exit: do panic earlier to get coredump if global
init task exit
On 12/12, qiwuchen55@...il.com 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.
Powered by blists - more mailing lists