kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	 Ricardo Ribalda <ribalda@google.com>,
	Ross Zwisler <zwisler@google.com>,
	Rob Clark <robdclark@gmail.com>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	kexec@lists.infradead.org
Subject: Re: [PATCH] kexec: Fix reboot race during device_shutdown()
Date: Wed, 11 Oct 2023 11:52:58 -0400	[thread overview]
Message-ID: <CAEXW_YT4JrLaVg9iXdbny9o4DrhUN21WNGDfVNbwJCa-ZvUPOQ@mail.gmail.com> (raw)
In-Reply-To: <87fs2ii3tf.fsf@email.froward.int.ebiederm.org>

On Tue, Oct 10, 2023 at 5:08 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> Joel Fernandes <joel@joelfernandes.org> writes:
[...]
> >> That way you can get the orderly shutdown
> >> of userspace daemons/services along with an orderly shutdown of
> >> everything the kernel is responsible for.
> >
> > Fixing in userspace is an option but people are not happy that the
> > kernel can crash like that.
>
> In a kexec on panic scenario the kernel needs to perform that absolute
> bare essential shutdown before calling kexec (basically nothing).
> During kexec-on-panic nothing can be relied upon because we don't know
> what is broken.  If that is what you care about (as suggested by the
> unit test) you need to fix the device initialization.
>
> In a normal kexec scenario the whole normal reboot process is expected.
> I have no problems with fixing the kernel to handle that scenario,
> but in the real world the entire orderly shutdown both, kernel
> and userspace should be performed.

Sounds good. Since you mentioned you have no problem with fixing
regular reboot in the kernel, we will work on reproducing the issue
with regular reboot as well and fix that.

I think a syscall causing the kernel to crash instead of operate
normally is a cause of concern, so let us fix the kernel as well
(other than improving the test case as you mentioned).

> >> At the kernel level a kexec reboot and a normal reboot have been
> >> deliberately kept as close as possible.  Which is why I say we should
> >> fix it in reboot.
> >
> > You mean fix it in userspace?
>
> No.  I mean in the kernel the orderly shutdown for a kexec reboot and an
> ordinary reboot are kept as close to the same as possible.
>
> It should be the case that the only differences between the two is that
> in once case system firmware takes over after the orderly shutdown,
> and in the other case a new kernel takes over after the orderly shutdown.

Agreed.

thanks,

 - Joel

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2023-10-11 15:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  2:12 [PATCH] kexec: Fix reboot race during device_shutdown() Joel Fernandes (Google)
2023-09-29 16:00 ` Eric W. Biederman
2023-10-02 18:18   ` Joel Fernandes
2023-10-08  1:30     ` Joel Fernandes
2023-10-09 14:01       ` Steven Rostedt
2023-10-10 20:43         ` Joel Fernandes
2023-10-09 15:21       ` Eric W. Biederman
2023-10-10 20:37         ` Joel Fernandes
2023-10-10 21:07           ` Eric W. Biederman
2023-10-11 15:52             ` Joel Fernandes [this message]

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=CAEXW_YT4JrLaVg9iXdbny9o4DrhUN21WNGDfVNbwJCa-ZvUPOQ@mail.gmail.com \
    --to=joel@joelfernandes.org \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ribalda@google.com \
    --cc=robdclark@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zwisler@google.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 read-only IMAP folder(s) and NNTP newsgroup(s).