Re: [PATCH v2 2/2] kexec: fix error propagation in kexec_image_probe_default()

From: Pratyush Yadav

Date: Thu Aug 20 2026 - 14:13:16 EST


On Wed, Aug 19 2026, Mukesh Pilaniya wrote:

> kexec_image_probe_default() overwrites ret with each loader's probe
> return value and returns whatever the last loader returned when no
> probe matches. The error code reaching userspace depends on whichever
> loader happens to be last in kexec_file_loaders[].
>
> Only continue to the next loader when a probe returns -ENOEXEC.
> Propagate any other error such as -ENOMEM immediately. Return -ENOEXEC
> only when all loaders have been tried and none matched.
>
> Suggested-by: Pratyush Yadav <pratyush@xxxxxxxxxx>
> Signed-off-by: Mukesh Pilaniya <mpilaniy@xxxxxxxxxx>

Reviewed-by: Pratyush Yadav <pratyush@xxxxxxxxxx>

[...]

--
Regards,
Pratyush Yadav