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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVpKC94_JPqp0foeeC9Uz8X6st8NLDryGkBqvCc=-CAdQ@mail.gmail.com>
Date: Wed, 12 Nov 2025 17:54:29 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Yuntao Wang <yuntao.wang@...ux.dev>
Cc: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>, 
	Catalin Marinas <catalin.marinas@....com>, James Morse <james.morse@....com>, 
	Baoquan He <bhe@...hat.com>, Zhen Lei <thunder.leizhen@...wei.com>, 
	Andrew Morton <akpm@...ux-foundation.org>, Changyuan Lyu <changyuanl@...gle.com>, 
	Alexander Graf <graf@...zon.com>, "Mike Rapoport (Microsoft)" <rppt@...nel.org>, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/10] of/fdt: Fix incorrect use of dt_root_addr_cells in early_init_dt_check_kho()

Hi Yuntao,

On Wed, 12 Nov 2025 at 15:38, Yuntao Wang <yuntao.wang@...ux.dev> wrote:
> When reading the fdt_size value, the argument passed to dt_mem_next_cell()
> is dt_root_addr_cells, but it should be dt_root_size_cells.
>
> The same issue occurs when reading the scratch_size value.
>
> Fix these issues.
>
> Fixes: 274cdcb1c004 ("arm64: add KHO support")
> Signed-off-by: Yuntao Wang <yuntao.wang@...ux.dev>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -894,14 +894,14 @@ static void __init early_init_dt_check_kho(void)
>                 return;
>
>         fdt_start = dt_mem_next_cell(dt_root_addr_cells, &p);
> -       fdt_size = dt_mem_next_cell(dt_root_addr_cells, &p);
> +       fdt_size = dt_mem_next_cell(dt_root_size_cells, &p);

I think it would be worthwhile to have separate dt_mem_next_addr_cell()
and dt_mem_next_size_cell() helpers.  That would us bring a few steps
closer to the following goal stated in <linux/of_fdt.h>:

    /* TBD: Temporary export of fdt globals - remove when code fully merged */
    extern int __initdata dt_root_addr_cells;
    extern int __initdata dt_root_size_cells;

>
>         p = of_get_flat_dt_prop(node, "linux,kho-scratch", &l);
>         if (l != dt_root_addr_size_bytes())
>                 return;
>
>         scratch_start = dt_mem_next_cell(dt_root_addr_cells, &p);
> -       scratch_size = dt_mem_next_cell(dt_root_addr_cells, &p);
> +       scratch_size = dt_mem_next_cell(dt_root_size_cells, &p);
>
>         kho_populate(fdt_start, fdt_size, scratch_start, scratch_size);
>  }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ