All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Qianli Zhao <zhaoqianligood@gmail.com>
Cc: christian@brauner.io, axboe@kernel.dk, ebiederm@xmission.com,
	tglx@linutronix.de, pcc@google.com, linux-kernel@vger.kernel.org,
	zhaoqianli@xiaomi.com
Subject: Re: [PATCH V2] exit: trigger panic when global init has exited
Date: Fri, 12 Mar 2021 17:23:45 +0100	[thread overview]
Message-ID: <20210312162344.GB27820@redhat.com> (raw)
In-Reply-To: <1615519478-178620-1-git-send-email-zhaoqianligood@gmail.com>

On 03/12, Qianli Zhao wrote:
>
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -767,6 +767,17 @@ void __noreturn do_exit(long code)
>  	validate_creds_for_do_exit(tsk);
>  
>  	/*
> +	 * If global init has exited,
> +	 * panic immediately to get a useable coredump.
> +	 */
> +	if (unlikely(is_global_init(tsk) &&
> +	    (thread_group_empty(tsk) ||
> +	    (tsk->signal->flags & SIGNAL_GROUP_EXIT)))) {
> +			panic("Attempted to kill init! exitcode=0x%08x\n",
> +				tsk->signal->group_exit_code ?: (int)code);

See our discussion with Eric, this is not right.
https://lore.kernel.org/lkml/20210310173236.GB8973@redhat.com/

Oleg.


  reply	other threads:[~2021-03-12 16:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12  3:24 [PATCH V2] exit: trigger panic when global init has exited Qianli Zhao
2021-03-12 16:23 ` Oleg Nesterov [this message]
2021-03-12 18:23 ` Eric W. Biederman
2021-03-13 13:12   ` qianli zhao

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=20210312162344.GB27820@redhat.com \
    --to=oleg@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=christian@brauner.io \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pcc@google.com \
    --cc=tglx@linutronix.de \
    --cc=zhaoqianli@xiaomi.com \
    --cc=zhaoqianligood@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.