[PATCH v11] ARM: uncompress: Validate start of physical memory against passed DTB

Stephen Boyd sboyd at kernel.org
Sun Dec 13 00:21:34 EST 2020


Quoting Geert Uytterhoeven (2020-12-10 01:32:01)
> diff --git a/arch/arm/boot/compressed/fdt_check_mem_start.c b/arch/arm/boot/compressed/fdt_check_mem_start.c
> new file mode 100644
> index 0000000000000000..e58c3a79c8a31ec4
> --- /dev/null
> +++ b/arch/arm/boot/compressed/fdt_check_mem_start.c
> @@ -0,0 +1,131 @@
[...]
> +
> +static uint64_t get_val(const fdt32_t *cells, uint32_t ncells)
> +{
> +       uint64_t r = 0;

This assignment is unnecessary?

> +
> +       r = fdt32_ld(cells);
> +       if (ncells > 1)
> +               r = (r << 32) | fdt32_ld(cells + 1);
> +
> +       return r;



More information about the linux-arm-kernel mailing list