On Tue, Aug 26 2025, Breno Leitao wrote:

> The kexec_buf structure was previously declared without initialization
> in image_load(). This led to a UBSAN warning when the structure was
> expanded and uninitialized fields were accessed [1].
>
> Zero-initializing kexec_buf at declaration ensures all fields are
> cleanly set, preventing future instances of uninitialized memory being
> used.
>
> Andrew Morton suggested that this function is only called 3x a week[2],
> thus, the memset() cost is inexpressive.

Yep, and it is only 80 bytes on an already very expensive kexec load
call.

>
> Link: 
> https://lore.kernel.org/all/oninomspajhxp4omtdapxnckxydbk2nzmrix7rggmpukpnzadw@c67o7njgdgm3/
>  [1]
> Link: 
> https://lore.kernel.org/all/[email protected]/
>  [2]
> Suggested-by: Andrew Morton <[email protected]>
> Signed-off-by: Breno Leitao <[email protected]>

Reviewed-by: Pratyush Yadav <[email protected]>

[...]

-- 
Regards,
Pratyush Yadav

Reply via email to