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:   Mon, 20 Jun 2022 09:44:27 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     "hch@...radead.org" <hch@...radead.org>,
        Christophe Leroy <christophe.leroy@...roup.eu>
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



On 6/17/22 13:30, hch@...radead.org wrote:
> On Fri, Jun 17, 2022 at 05:48:11AM +0000, Christophe Leroy wrote:
>> Is it a good idea to duplicate vm_get_page_prot() in each architecture ? 
> 
> It is a completely trivial array index.  And I really like the idea
> of not having the protection_map in common code - it really is an
> implementation detail.  But what we could do is something like
> 
> #define DECLARE_VM_GET_PAGE_PROT				\
> pgprot_t vm_get_page_prot(unsigned long vm_flags)		\
> {								\
>         return protection_map[vm_flags &			\
> 		(VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)];	\
> }								\
> EXPORT_SYMBOL(vm_get_page_prot);
> 
> as a helper for the architectures.

Agreed, this will ensure the exact same implementation for all platforms
(except those custom vm_get_page_prot), without deviations and mistakes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ