[PATCH 4/5] kexec_core: Clear the unused part of CMA segments
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Oct 23 01:04:12 PDT 2026
> From: Han Gao <gaohan at iscas.ac.cn>
>
> kimage_load_cma_segment() copies the source data into pages that are not
> cleared, but zeroes nothing after it: the final memset() runs once the
> loop has consumed all of memsz. The tail of the last source page and
> every page beyond bufsz keep stale data, while the purgatory digest
> covers them as zeroes.
>
> A kexec_file reboot then stops in purgatory on a digest mismatch, for
> instance when the DTB lands in a reused CMA page.
>
> Zero the remainder of each page instead.
>
> Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation")
> Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-riscv-kexec-cma-fixes-v1-0-825b90ea23c4@iscas.ac.cn?part=4
More information about the kexec
mailing list