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]
Date:   Fri, 25 Feb 2022 10:02:45 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Linux MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Christoph Hellwig <hch@...radead.org>,
        Linux-Arch <linux-arch@...r.kernel.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        linux-m68k <linux-m68k@...ts.linux-m68k.org>
Subject: Re: [PATCH V2 08/30] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

Hi Anshuman, Andrew,

On Mon, Feb 21, 2022 at 12:54 PM Geert Uytterhoeven
<geert@...ux-m68k.org> wrote:
> On Mon, Feb 21, 2022 at 9:45 AM Anshuman Khandual
> <anshuman.khandual@....com> wrote:
> > This defines and exports a platform specific custom vm_get_page_prot() via
> > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX
> > macros can be dropped which are no longer needed.
> >
> > Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
> > Cc: linux-m68k@...ts.linux-m68k.org
> > Cc: linux-kernel@...r.kernel.org
> > Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
>
> Thanks for your patch!
>
> > --- a/arch/m68k/mm/init.c
> > +++ b/arch/m68k/mm/init.c
> > @@ -128,3 +128,107 @@ void __init mem_init(void)
> >         memblock_free_all();
> >         init_pointer_tables();
> >  }
> > +
> > +#ifdef CONFIG_COLDFIRE
> > +/*
> > + * Page protections for initialising protection_map. See mm/mmap.c
> > + * for use. In general, the bit positions are xwr, and P-items are
> > + * private, the S-items are shared.
> > + */
> > +pgprot_t vm_get_page_prot(unsigned long vm_flags)
>
> Wouldn't it make more sense to add this to arch/m68k/mm/mcfmmu.c?

It's not just about sense, but also about correctness.
The CF_PAGE_* definitions below exist only if CONFIG_MMU=y,
thus causing breakage for cfnommu in today's linux-next.
http://kisskb.ellerman.id.au/kisskb/buildresult/14701640/

>
> > +{
> > +       switch (vm_flags & (VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)) {
> > +       case VM_NONE:
> > +               return PAGE_NONE;
> > +       case VM_READ:
> > +               return __pgprot(CF_PAGE_VALID | CF_PAGE_ACCESSED |
> > +                               CF_PAGE_READABLE);

> > +               BUILD_BUG();
> > +       }
> > +}
> > +#endif
> > +EXPORT_SYMBOL(vm_get_page_prot);

Having this outside the #ifdef means we now get ...

> > --- a/arch/m68k/mm/motorola.c
> > +++ b/arch/m68k/mm/motorola.c

> > +}
> > +EXPORT_SYMBOL(vm_get_page_prot);

... two of them in normal m68k builds.

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