From: Oleg Nesterov <oleg@redhat.com>
To: qiwuchen55@gmail.com
Cc: peterz@infradead.org, mingo@kernel.org,
christian.brauner@ubuntu.com, kernel-team@android.com,
linux-kernel@vger.kernel.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH] kernel/exit: do panic earlier to get coredump if global init task exit
Date: Thu, 12 Dec 2019 11:08:38 +0100 [thread overview]
Message-ID: <20191212100838.GB5460@redhat.com> (raw)
In-Reply-To: <20191212095127.GA5460@redhat.com>
can't you use is_global_init() && group_dead ?
On 12/12, Oleg Nesterov wrote:
>
> On 12/12, qiwuchen55@gmail.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.
next prev parent reply other threads:[~2019-12-12 10:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 6:14 [PATCH] kernel/exit: do panic earlier to get coredump if global init task exit qiwuchen55
2019-12-12 9:51 ` Oleg Nesterov
2019-12-12 10:08 ` Oleg Nesterov [this message]
2019-12-12 11:05 ` Christian Brauner
2019-12-14 6:27 ` chenqiwu
2019-12-14 11:48 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191212100838.GB5460@redhat.com \
--to=oleg@redhat.com \
--cc=chenqiwu@xiaomi.com \
--cc=christian.brauner@ubuntu.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qiwuchen55@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).