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] [day] [month] [year] [list]
Message-ID: <CAHVXubidb5gQBHSFMJiY=egoi4QOiqOh884VvAhxYqADxNDB6A@mail.gmail.com>
Date:   Wed, 14 Dec 2022 17:38:08 +0100
From:   Alexandre Ghiti <alexghiti@...osinc.com>
To:     Björn Töpel <bjorn@...nel.org>
Cc:     Jonathan Corbet <corbet@....net>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] riscv: Allow to downgrade paging mode from the command line

On Wed, Dec 14, 2022 at 4:39 PM Björn Töpel <bjorn@...nel.org> wrote:
>
> Alexandre Ghiti <alexghiti@...osinc.com> writes:
>
> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> > index b56a0a75533f..8140fefe0e57 100644
> > --- a/arch/riscv/mm/init.c
> > +++ b/arch/riscv/mm/init.c
> > @@ -752,12 +752,35 @@ static void __init disable_pgtable_l4(void)
> >   * then read SATP to see if the configuration was taken into account
> >   * meaning sv48 is supported.
> >   */
> > -static __init void set_satp_mode(void)
> > +static __init void set_satp_mode(uintptr_t dtb_pa)
> >  {
> >       u64 identity_satp, hw_satp;
> >       uintptr_t set_satp_mode_pmd = ((unsigned long)set_satp_mode) & PMD_MASK;
> >       bool check_l4 = false;
> >
> > +#ifndef CONFIG_KASAN
> > +     /*
> > +      * The below fdt functions are kasan instrumented, since at this point
> > +      * there is no mapping for the kasan shadow memory, this can't be used
> > +      * when kasan is enabled.
> > +      */
> > +     int chosen_node;
> > +
> > +     chosen_node = fdt_path_offset((void *)dtb_pa, "/chosen");
> > +     if (chosen_node >= 0) {
> > +             const char *cmdline = fdt_getprop((void *)dtb_pa, chosen_node,
> > +                                               "bootargs", NULL);
>
> The command line handling needs to honor CONFIG_CMDLINE_FORCE and
> CONFIG_CMDLINE_EXTEND (which makes it possible to use no{4,5}lvl *and*
> KASAN ;-)).
>

Indeed, I forgot that, thanks for noticing! I'll prepare the "real"
command line before matching the new parameters.

Thanks again,

Alex

>
> Björn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ