[PATCH v2 1/3] kho: Adopt KHO radix tree data structures

Pasha Tatashin pasha.tatashin at soleen.com
Thu Oct 23 18:23:30 PDT 2025


On Thu, Oct 23, 2025 at 7:45 PM Jason Gunthorpe <jgg at nvidia.com> wrote:
>
> On Mon, Oct 20, 2025 at 03:03:04AM -0700, Jason Miu wrote:
>
> > +static struct kho_radix_tree *kho_alloc_radix_tree(void)
> >  {
> > +     return (struct kho_radix_tree *)get_zeroed_page(GFP_KERNEL);
> > +}
>
> I was reading the thread over here:
>
> https://lore.kernel.org/all/20151222210435.GB20997@ZenIV.linux.org.uk/
>
> And I guess this stuff should just use
>   kzalloc(sizeof(struct kho_radix_tree), GFP_KERNEL);

kzalloc() uses slab, which in turn may use kfence objects, and kfence
can allocate memory from KHO scratch area, leading to memory
corruptions. Let's not use slab allocator for KHO preserved and
metadata memory, it is not a good choice.

Pasha



More information about the kexec mailing list