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: <85fff3f6-373f-3e6a-325e-0fa8ad46273a@csgroup.eu>
Date:   Wed, 6 Jul 2022 06:33:54 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC:     "hch@...radead.org" <hch@...radead.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "openrisc@...ts.librecores.org" <openrisc@...ts.librecores.org>,
        "linux-xtensa@...ux-xtensa.org" <linux-xtensa@...ux-xtensa.org>,
        "linux-csky@...r.kernel.org" <linux-csky@...r.kernel.org>,
        "linux-hexagon@...r.kernel.org" <linux-hexagon@...r.kernel.org>,
        "linux-parisc@...r.kernel.org" <linux-parisc@...r.kernel.org>,
        "linux-alpha@...r.kernel.org" <linux-alpha@...r.kernel.org>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
        "linux-ia64@...r.kernel.org" <linux-ia64@...r.kernel.org>,
        "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
        "linux-m68k@...ts.linux-m68k.org" <linux-m68k@...ts.linux-m68k.org>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-um@...ts.infradead.org" <linux-um@...ts.infradead.org>,
        "linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across
 platforms



Le 06/07/2022 à 07:57, Anshuman Khandual a écrit :
> 
> 
> On 6/30/22 10:46, Anshuman Khandual wrote:
>> __SXXX/__PXXX macros is an unnecessary abstraction layer in creating the
>> generic protection_map[] array which is used for vm_get_page_prot(). This
>> abstraction layer can be avoided, if the platforms just define the array
>> protection_map[] for all possible vm_flags access permission combinations
>> and also export vm_get_page_prot() implementation.
>>
>> This series drops __SXXX/__PXXX macros from across platforms in the tree.
>> First it build protects generic protection_map[] array with '#ifdef __P000'
>> and moves it inside platforms which enable ARCH_HAS_VM_GET_PAGE_PROT. Later
>> this build protects same array with '#ifdef ARCH_HAS_VM_GET_PAGE_PROT' and
>> moves inside remaining platforms while enabling ARCH_HAS_VM_GET_PAGE_PROT.
>> This adds a new macro DECLARE_VM_GET_PAGE_PROT defining the current generic
>> vm_get_page_prot(), in order for it to be reused on platforms that do not
>> require custom implementation. Finally, ARCH_HAS_VM_GET_PAGE_PROT can just
>> be dropped, as all platforms now define and export vm_get_page_prot(), via
>> looking up a private and static protection_map[] array. protection_map[]
>> data type has been changed as 'static const' on all platforms that do not
>> change it during boot.
>>
>> This series applies on v5.19-rc4 and has been build tested for multiple
>> platforms. While here it has dropped off all previous tags from folks after
>> the current restructuring. Series common CC list has been expanded to cover
>> all impacted platforms for wider reach.
>>
>> - Anshuman
>>
>> Changes in V6:
>>
>> - Converted protection_map[] array as 'static const' on sparc32 platform
>> - Rebased on v5.19-rc4
>> - Collected tags
> 
> There are two linux-next based build fixes for this series (listed below), when
> vm_get_page_prot() gets redefined with !CONFIG_MMU. Platform vm_get_page_prot()
> is required only with CONFIG_MMU enabled, otherwise there is a generic fallback
> stub in include/linux/mm.h
> 
> https://lore.kernel.org/all/20220705221411.3381797-1-jcmvbkbc@gmail.com/	[xtensa]
> https://lore.kernel.org/all/20220706054002.1936820-1-anshuman.khandual@arm.com/ [sh]
> 
> It does not seem CONFIG_MMU can be disabled on other platforms thus exposing a build
> failure. But just to be on the safer side, should all vm_get_page_prot() be wrapped
> around with #ifdef CONFIG_MMU ? In that case will resend the series with above build
> fixes folded back in as well. Please do suggest. Thank you.
> 

As far as I can see in Kconfig, CONFIG_MMU is user selectable on the 
following architectures:
- ARM
- M68K
- RISCV
- SH

And is disabled by default on XTENSA.

So I guess ARM, M68K, RISCV, SH and XTENSA should have it wrapped around 
#ifdef CONFIG_MMU , or have it in a file that is not built when 
CONFIG_MMU is not set.

Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ