Re: [PATCH AUTOSEL 4.9 1/8] of/fdt: Don't calculate initrd size from DT if start > end

From: Pavel Machek
Date: Tue Oct 18 2022 - 05:37:33 EST


Hi!

> It should be stressed, it is generally a fault of the bootloader's with
> the kernel relying on it, however we should not allow the bootloader's
> misconfiguration to lead to the kernel oops. Not only the kernel
> should be

I believe we should at least printk() if we detect bootloader bug of
this severity.

Best regards,
Pavel


> +++ b/drivers/of/fdt.c
> @@ -917,6 +917,8 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
> if (!prop)
> return;
> end = of_read_number(prop, len/4);
> + if (start > end)
> + return;
>
> __early_init_dt_declare_initrd(start, end);
>
> --
> 2.35.1

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature