[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mafs0qzwyxmz9.fsf@kernel.org>
Date: Tue, 26 Aug 2025 14:54:02 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: Catalin Marinas <catalin.marinas@....com>, Will Deacon
<will@...nel.org>, kexec@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
bhe@...hat.com, oxu@...hat.com, berrange@...hat.com,
kernel-team@...a.com, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] arm64: kexec: Initialize kexec_buf struct in image_load()
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/20250825180531.94bfb86a26a43127c0a1296f@linux-foundation.org/ [2]
> Suggested-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Breno Leitao <leitao@...ian.org>
Reviewed-by: Pratyush Yadav <pratyush@...nel.org>
[...]
--
Regards,
Pratyush Yadav
Powered by blists - more mailing lists