[PATCH v2 05/13] kho: Verify deserialization status and fix FDT alignment access

Pratyush Yadav pratyush at kernel.org
Fri Nov 14 11:33:54 PST 2025


On Fri, Nov 14 2025, Pasha Tatashin wrote:

> During boot, kho_restore_folio() relies on the memory map having been
> successfully deserialized. If deserialization fails or no map is
> present, attempting to restore the FDT folio is unsafe.
>
> Update kho_mem_deserialize() to return a boolean indicating success. Use
> this return value in kho_memory_init() to disable KHO if deserialization
> fails. Also, the incoming FDT folio is never used, there is no reason to
> restore it.
>
> Additionally, use get_unaligned() to retrieve the memory map pointer
> from the FDT. FDT properties are not guaranteed to be naturally aligned,
> and accessing a 64-bit value via a pointer that is only 32-bit aligned
> can cause faults.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin at soleen.com>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt at kernel.org>

Reviewed-by: Pratyush Yadav <pratyush at kernel.org>

[...]

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list