Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-11 Thread Joel Fernandes
On Tue, Oct 10, 2023 at 5:08 PM Eric W. Biederman wrote: > > Joel Fernandes 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

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-10 Thread Eric W. Biederman
Joel Fernandes writes: > On Mon, Oct 9, 2023 at 11:30 AM Eric W. Biederman > wrote: >> >> Joel Fernandes writes: >> >> > On Mon, Oct 2, 2023 at 2:18 PM Joel Fernandes >> > wrote: >> > [..] >> >> > > Such freezing is already being done if kernel supports KEXEC_JUMP and >> >> > >

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-10 Thread Joel Fernandes
On Mon, Oct 9, 2023 at 10:00 AM Steven Rostedt wrote: > > On Sat, 7 Oct 2023 21:30:42 -0400 > Joel Fernandes wrote: > > > 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

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-10 Thread Joel Fernandes
On Mon, Oct 9, 2023 at 11:30 AM Eric W. Biederman wrote: > > Joel Fernandes writes: > > > On Mon, Oct 2, 2023 at 2:18 PM Joel Fernandes > > wrote: > > [..] > >> > > Such freezing is already being done if kernel supports KEXEC_JUMP and > >> > > kexec_image->preserve_context is true. However,

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-09 Thread Eric W. Biederman
Joel Fernandes writes: > On Mon, Oct 2, 2023 at 2:18 PM Joel Fernandes 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

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-09 Thread Steven Rostedt
On Sat, 7 Oct 2023 21:30:42 -0400 Joel Fernandes wrote: > 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? If you can

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-07 Thread Joel Fernandes
On Mon, Oct 2, 2023 at 2:18 PM Joel Fernandes 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

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-10-02 Thread Joel Fernandes
Hi Eric, On Fri, Sep 29, 2023 at 12:01 PM Eric W. Biederman wrote: > > "Joel Fernandes (Google)" writes: > > > During kexec reboot, it is possible for a race to occur between > > device_shutdown() and userspace. This causes accesses to GPU after > > pm_runtime > > suspend has already

Re: [PATCH] kexec: Fix reboot race during device_shutdown()

2023-09-29 Thread Eric W. Biederman
"Joel Fernandes (Google)" writes: > During kexec reboot, it is possible for a race to occur between > device_shutdown() and userspace. This causes accesses to GPU after pm_runtime > suspend has already happened. Fix this by calling freeze_processes() before > device_shutdown(). Is there any

[PATCH] kexec: Fix reboot race during device_shutdown()

2023-09-28 Thread Joel Fernandes (Google)
During kexec reboot, it is possible for a race to occur between device_shutdown() and userspace. This causes accesses to GPU after pm_runtime suspend has already happened. Fix this by calling freeze_processes() before device_shutdown(). Such freezing is already being done if kernel supports