lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mafs01pmsfxkh.fsf@kernel.org>
Date: Fri, 24 Oct 2025 11:39:26 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: Pratyush Yadav <pratyush@...nel.org>,  Pasha Tatashin
 <pasha.tatashin@...een.com>,  akpm@...ux-foundation.org,
  brauner@...nel.org,  corbet@....net,  graf@...zon.com,  jgg@...pe.ca,
  linux-kernel@...r.kernel.org,  linux-kselftest@...r.kernel.org,
  linux-mm@...ck.org,  masahiroy@...nel.org,  ojeda@...nel.org,
  rdunlap@...radead.org,  tj@...nel.org
Subject: Re: [PATCHv7 3/7] kho: drop notifiers

On Fri, Oct 24 2025, Mike Rapoport wrote:

> On Wed, Oct 22, 2025 at 01:01:08PM +0200, Pratyush Yadav wrote:
>> Hi Pasha,
>> 
>> On Tue, Oct 21 2025, Pasha Tatashin wrote:
>> 
>> > From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
>> >
>> > The KHO framework uses a notifier chain as the mechanism for clients to
>> > participate in the finalization process. While this works for a single,
>> > central state machine, it is too restrictive for kernel-internal
>> > components like pstore/reserve_mem or IMA. These components need a
>> > simpler, direct way to register their state for preservation (e.g.,
>> > during their initcall) without being part of a complex,
>> > shutdown-time notifier sequence. The notifier model forces all
>> > participants into a single finalization flow and makes direct
>> > preservation from an arbitrary context difficult.
>> > This patch refactors the client participation model by removing the
>> > notifier chain and introducing a direct API for managing FDT subtrees.
>> >
>> > The core kho_finalize() and kho_abort() state machine remains, but
>> > clients now register their data with KHO beforehand.
>> >
>
> ...
>
>> > @@ -1280,7 +1298,7 @@ static __init int kho_init(void)
>> >  	kho_enable = false;
>> >  	return err;
>> >  }
>> > -late_initcall(kho_init);
>> > +fs_initcall(kho_init);
>> 
>> Is this change related to this patch? Also, why fs_initcall?
>
> memblock registers sub-fdt in late_initcall(), so we should have the root
> fdt ready by then. 

I see. Should this be even earlier then? Other components might also
depend on KHO being initialized, and those might be at or before
fs_initcall.

For example, LUO does its init using early_initcall and uses KHO, even
before it is initialized [0]. This works because kho_retrieve_subtree()
only uses parts initialized very early in boot (the KHO FDT), but I
suppose we want to have a proper initialization order to not rely on
things that just happen to work until they don't.

Since kho_init() has a dependency on debugfs, which gets initialized in
core_initcall, I guess the earliest it can be is postcore_initcall. Or,
we split out the debugfs parts into a separate init function (they have
their own file anyway) and initialize "core KHO" in early_initcall? Then
LUO can be in core_initcall and all its users in later ones.

Thoughts?

[0] https://lore.kernel.org/lkml/20250929010321.3462457-9-pasha.tatashin@soleen.com/

-- 
Regards,
Pratyush Yadav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ