Re: [PATCH v11 05/11] riscv: kexec_file: Fix potential buffer overflow in prepare_elf_headers()
From: Guo Ren
Date: Sun Mar 29 2026 - 23:47:59 EST
On Sat, Mar 28, 2026 at 3:41 PM Jinjie Ruan <ruanjinjie@xxxxxxxxxx> wrote:
>
> There is a race condition between the kexec_load() system call
> (crash kernel loading path) and memory hotplug operations that can lead
> to buffer overflow and potential kernel crash.
riscv left no margin for hotplug in prepare_elf_headers(). Actually,
this check has been in crash_exclude_mem_range(); this patch makes it
happen earlier.
Although this patch has no real effect for riscv for the current. I
still give an acked-by, because it's a proper check step in this
callback.
Reviewed-by: Guo Ren <guoren@xxxxxxxxxx>
--
Best Regards
Guo Ren