[PATCH] kho: add support for deferred struct page init

Pratyush Yadav pratyush at kernel.org
Mon Dec 29 13:09:21 PST 2025


On Wed, Dec 24 2025, Fadouse wrote:

> Hi Evangelos, Mike, Pasha, Pratyush,
>
> I independently hit a crash in the LUO/memfd restore path with
> CONFIG_DEFERRED_STRUCT_PAGE_INIT=y, on a local build based on dd9b004b7ff3
> (x86_64 QEMU, 6.19.0-rc1 timeframe).

How? config KEXEC_HANDOVER depends on !DEFERRED_STRUCT_PAGE_INIT. So you
shouldn't even be able to enable KHO or LUO with
CONFIG_DEFERRED_STRUCT_PAGE_INIT=y. Are you sure it is enabled?

>
> In my reproducer, stage1 preserves a memfd via LUO and kexecs into stage2;
> stage2 calls LIVEUPDATE_SESSION_FINISH without retrieving files. I observed
> a reliable crash in adjust_managed_page_count() from kho_restore_page().
>
> Minimal excerpt:
>
> stage2: start
> stage2: retrieved session fd=4
> BUG: unable to handle page fault for address: 0000000000001410
> RIP: adjust_managed_page_count+0x29/0x40
> Call Trace:
>   kho_restore_page+0x18a/0x1c0
>   kho_restore_folio+0xe/0x60
>   memfd_luo_finish+0xe6/0x160
>   luo_file_finish+0x188/0x240
>   luo_session_finish+0x2c/0x80
>   luo_session_ioctl+0xf5/0x170
>   __x64_sys_ioctl+0x91/0xe0
>
> Applying the patch in <20251216084913.86342-1-epetron at amazon.de> makes the
> issue no longer reproduce for me.
>
> I can share full logs and the small two-stage initramfs reproducer if needed.
>
> Thanks,
> YanXin Li
>
> Tested-by: YanXin Li <fadouse at proton.me>
>
[...]

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list