[PATCH v2 3/9] kho: validate preservation metadata in kho_restore_vmalloc()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sun Oct 25 10:56:57 PDT 2026


> kho_restore_vmalloc() currently dereferences preservation before
> checking for NULL, does not reject unknown KHO vmalloc flags, and does
> not validate preservation->first.phys, preservation->total_pages, or
> preservation->order before allocating the pages array and shifting by
> order.
> 
> Move kho_flags_to_vmalloc() to kexec_handover_common.c and introduce
> kho_vmalloc_validate() and kho_vmalloc_walk() so both regular KHO and
> the upcoming read-only KHO mode can share vmalloc header validation and
> chunk-list traversal. Converting kho_restore_vmalloc() to
> kho_vmalloc_walk() also restores each chunk page before reading its
> contents and rejects non-terminal chunks that are not completely full.
> 
> Signed-off-by: Pasha Tatashin <pasha.tatashin at soleen.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025174017.3870481-1-pasha.tatashin@soleen.com?part=3




More information about the kexec mailing list