lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKXWOb7i8aBOmRhsSUVad=v2r095uw7gFHMqf_+96eEyw@mail.gmail.com>
Date:   Wed, 16 Jun 2021 11:14:36 -0600
From:   Rob Herring <robh+dt@...nel.org>
To:     Geert Uytterhoeven <geert+renesas@...der.be>
Cc:     Frank Rowand <frowand.list@...il.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] of: kexec: Always use FDT_PROP_INITRD_START and FDT_PROP_INITRD_END

On Wed, Jun 16, 2021 at 3:27 AM Geert Uytterhoeven
<geert+renesas@...der.be> wrote:
>
> Commit b30be4dc733e5067 ("of: Add a common kexec FDT setup function")
> introduced macros FDT_PROP_INITRD_* to refer to initrd properties, but
> didn't use them everywhere.  Convert the remaining users from string
> literals to macros.

I'm not really a fan of the defines, so if anything I'd get rid of
them. But the bigger problem is what you brought to light with the
variable size. As I mentioned, we should refactor this and the fdt.c
code to have a common function to read the initrd start and end.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> ---
>  drivers/of/kexec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c
> index f335d941a716e841..3fe585d5a82732e7 100644
> --- a/drivers/of/kexec.c
> +++ b/drivers/of/kexec.c
> @@ -318,13 +318,13 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image,
>                 goto out;
>
>         /* Did we boot using an initrd? */
> -       prop = fdt_getprop(fdt, chosen_node, "linux,initrd-start", NULL);
> +       prop = fdt_getprop(fdt, chosen_node, FDT_PROP_INITRD_START, NULL);
>         if (prop) {
>                 u64 tmp_start, tmp_end, tmp_size;
>
>                 tmp_start = fdt64_to_cpu(*((const fdt64_t *) prop));
>
> -               prop = fdt_getprop(fdt, chosen_node, "linux,initrd-end", NULL);
> +               prop = fdt_getprop(fdt, chosen_node, FDT_PROP_INITRD_END, NULL);
>                 if (!prop) {
>                         ret = -EINVAL;
>                         goto out;
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ