From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Joel Fernandes <joel@joelfernandes.org>
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: Mon, 09 Oct 2023 10:21:04 -0500 [thread overview]
Message-ID: <87il7fzusf.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <CAEXW_YQ3YZExYb6FLg3fvWr9K+FGgNQx7xk3p-PngLG6rt8Ntw@mail.gmail.com> (Joel Fernandes's message of "Sat, 7 Oct 2023 21:30:42 -0400")
Joel Fernandes <joel@joelfernandes.org> writes:
> On Mon, Oct 2, 2023 at 2:18 PM Joel Fernandes <joel@joelfernandes.org> wrote:
> [..]
>> > > Such freezing is already being done if kernel supports KEXEC_JUMP and
>> > > kexec_image->preserve_context is true. However, doing it if either of these are
>> > > not true prevents crashes/races.
>> >
>> > The KEXEC_JUMP case is something else entirely. It is supposed to work
>> > like suspend to RAM. Maybe reboot should as well, but I am
>> > uncomfortable making a generic device fix kexec specific.
>>
>> I see your point of view. I think regular reboot should also be fixed
>> to avoid similar crash possibilities. I am happy to make a change for
>> that similar to this patch if we want to proceed that way.
>>
>> Thoughts?
>
> Just checking how we want to proceed, is the consensus that we should
> prevent kernel crashes without relying on userspace stopping all
> processes? Should we fix regular reboot syscall as well and not just
> kexec reboot?
It just occurred to me there is something very fishy about all of this.
What userspace do you have using kexec (not kexec on panic) that doesn't
preform the same userspace shutdown as a normal reboot?
Quite frankly such a userspace is buggy, and arguably that is where you
should start fixing things. That way you can get the orderly shutdown
of userspace daemons/services along with an orderly shutdown of
everything the kernel is responsible for.
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.
Eric
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2023-10-09 15:31 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 [this message]
2023-10-10 20:37 ` Joel Fernandes
2023-10-10 21:07 ` Eric W. Biederman
2023-10-11 15:52 ` Joel Fernandes
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=87il7fzusf.fsf@email.froward.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=joel@joelfernandes.org \
--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