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: <CAMuHMdX0dpQdZSCJGuOM0MgM3N-8OA29skARvXEkm87eOPEWBA@mail.gmail.com>
Date: Thu, 13 Jun 2024 18:42:39 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Russell King <linux@...linux.org.uk>, Arnd Bergmann <arnd@...db.de>, 
	Andrew Morton <akpm@...ux-foundation.org>, Geert Uytterhoeven <geert+renesas@...der.be>, 
	Linus Walleij <linus.walleij@...aro.org>, 
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Thomas Gleixner <tglx@...utronix.de>, 
	Jonathan Corbet <corbet@....net>, Marc Zyngier <maz@...nel.org>, "Mike Rapoport (IBM)" <rppt@...nel.org>, 
	Eric DeVolder <eric.devolder@...cle.com>, Nathan Chancellor <nathan@...nel.org>, 
	Kees Cook <keescook@...omium.org>, 
	"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, Bjorn Andersson <andersson@...nel.org>, 
	Konrad Dybcio <konrad.dybcio@...ainline.org>, John Crispin <john@...ozen.org>
Subject: Re: [PATCH v2 1/2] ARM: decompressor: support memory start validation
 for appended DTB

On Sun, Jan 21, 2024 at 9:30 PM Christian Marangi <ansuelsmth@...il.com> wrote:
> There is currently a problem with a very specific sets of kernel config
> and AUTO_ZRELADDR.
>
> For the most common case AUTO_ZRELADDR check the PC register and
> calculate the start of the physical memory. Then fdt_check_mem_start is
> called to make sure the detected value makes sense by comparing it with
> what is present in DTB in the memory nodes and if additional fixup are
> required with the use of linux,usable-memory-range in the chosen node to
> hardcode usable memory range in case some reserved space needs to be
> addressed. With the help of this function the right address is
> calculated and the kernel correctly decompress and loads.
>
> Things starts to become problematic when in the mix,
> CONFIG_ARM_APPENDED_DTB is used. This is a particular kernel config is
> used when legacy systems doesn't support passing a DTB directly and a
> DTB is appended at the end of the image.
>
> In such case, fdt_check_mem_start is skipped in AUTO_ZRELADDR iteration
> as the appended DTB can be augumented later with ATAGS passed from the
> bootloader (if CONFIG_ARM_ATAG_DTB_COMPAT is enabled).
>
> The main problem and what this patch address is the fact that
> fdt_check_mem_start is never called later when the appended DTB is
> augumented, hence any fixup and validation is not done making AUTO_ZRELADDR
> detection inconsistent and most of the time wrong.
>
> Add support in head.S for this by checking if AUTO_ZRELADDR is enabled
> and calling fdt_check_mem_start with the appended DTB and the augumented
> values permitting legacy device to provide info in DTB instead of
> disabling AUTO_ZRELADDR and hardcoding the physical address offsets.
>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

I have been including this series in my local tree for a few months,
and so far no regressions on any of the Renesas ARM32 platforms
I regularly test on.

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

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