Re: [PATCH] of: fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()

From: Geert Uytterhoeven

Date: Mon Nov 03 2025 - 10:25:40 EST


Hi Yuntaoi,

On Sun, 2 Nov 2025 at 15:18, Yuntao Wang <yuntao.wang@xxxxxxxxx> wrote:
> The len value is in bytes, while `dt_root_addr_cells + dt_root_size_cells`
> is in cells (4 bytes per cell).
>
> Comparing them directly is incorrect. Convert units before comparison.

Thanks for your patch!

> Fixes: f7e7ce93aac1 ("of: fdt: Add generic support for handling elf core headers property")

My commit consolidated existing code, so you may want to add
Fixes: e62aaeac426ab1dd ("arm64: kdump: provide /proc/vmcore file")
so code in v5.14 and older will be fixed by stable backports, too.

> Signed-off-by: Yuntao Wang <yuntao.wang@xxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds