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, 17 Jun 2022 05:48:11 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        "hch@...radead.org" <hch@...radead.org>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        kernel test robot <lkp@...el.com>,
        Christoph Hellwig <hch@....de>
Subject: Re: [PATCH V3 2/2] mm/mmap: Drop generic protection_map[] array



Le 17/06/2022 à 05:29, Anshuman Khandual a écrit :
> 
> 
> On 6/16/22 11:42, hch@...radead.org wrote:
>> On Thu, Jun 16, 2022 at 05:45:39AM +0000, Christophe Leroy wrote:
>>>> +/* Note due to the way vm flags are laid out, the bits are XWR */
>>>> +pgprot_t protection_map[16] = {
>>>
>>> Was const previously, now back to non const ? Maybe due to a conflict
>>> with linux/mm.h ? At least it should be __ro_after_init.
>>
>> Maybe we just need to duplicate vm_get_page_prot in all the
>> architectures and thus avoid making protection_map global in a
>> common header entirely.  That certainly seems like the cleaner
>> interface.
> 
> Agreed, also it does free up the platforms to provide any appropriate
> qualifiers for the protection_map[] array i.e __ro_after_init, const
> etc without impacting generic declaration used in a generic function.

Maybe all we need is to keep protection_map[] declaration architecture 
specific.

Is it a good idea to duplicate vm_get_page_prot() in each architecture ? 
Maybe it is, but it will also mean changing common code like 
mm/debug_vm_pgtable.c which accesses protection_map[] directly as of today.

On the other hand it means we can then drop 
CONFIG_ARCH_HAS_VM_GET_PAGE_PROT completely at the end. In a way that's 
a way back into your first version of the series, but without the uggly 
switch/case, maybe that's the best solution after all.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ