[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+CK2bAE5A4rvgxNzJbmdcTHWJ6LiyoQ5v8uMbTH4p6YxxToTg@mail.gmail.com>
Date: Mon, 27 Oct 2025 20:03:29 -0400
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: David Matlack <dmatlack@...gle.com>
Cc: 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, pratyush@...nel.org, rdunlap@...radead.org, rppt@...nel.org,
tj@...nel.org, jasonmiu@...gle.com, skhawaja@...gle.com
Subject: Re: [PATCH v3 3/3] liveupdate: kho: allocate metadata directly from
the buddy allocator
On Mon, Oct 27, 2025 at 7:05 PM David Matlack <dmatlack@...gle.com> wrote:
>
> On Mon, Oct 20, 2025 at 5:09 PM Pasha Tatashin
> <pasha.tatashin@...een.com> wrote:
> >
> > KHO allocates metadata for its preserved memory map using the slab
> > allocator via kzalloc(). This metadata is temporary and is used by the
> > next kernel during early boot to find preserved memory.
> >
> > A problem arises when KFENCE is enabled. kzalloc() calls can be
> > randomly intercepted by kfence_alloc(), which services the allocation
> > from a dedicated KFENCE memory pool. This pool is allocated early in
> > boot via memblock.
> >
> > When booting via KHO, the memblock allocator is restricted to a "scratch
> > area", forcing the KFENCE pool to be allocated within it. This creates a
> > conflict, as the scratch area is expected to be ephemeral and
> > overwriteable by a subsequent kexec. If KHO metadata is placed in this
> > KFENCE pool, it leads to memory corruption when the next kernel is
> > loaded.
> >
> > To fix this, modify KHO to allocate its metadata directly from the buddy
> > allocator instead of slab.
> >
> > Fixes: fc33e4b44b27 ("kexec: enable KHO support for memory preservation")
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@...een.com>
> > Reviewed-by: Pratyush Yadav <pratyush@...nel.org>
>
> Reviewed-by: David Matlack <dmatlack@...gle.com>
Thank you,
Pasha
Powered by blists - more mailing lists