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
| ||
|
Date: Wed, 4 Mar 2020 10:49:13 +0530 From: Anshuman Khandual <anshuman.khandual@....com> To: Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org Cc: Richard Henderson <rth@...ddle.net>, Vineet Gupta <vgupta@...opsys.com>, Russell King <linux@...linux.org.uk>, Catalin Marinas <catalin.marinas@....com>, Mark Salter <msalter@...hat.com>, Guo Ren <guoren@...nel.org>, Yoshinori Sato <ysato@...rs.sourceforge.jp>, Brian Cain <bcain@...eaurora.org>, Tony Luck <tony.luck@...el.com>, Geert Uytterhoeven <geert@...ux-m68k.org>, Michal Simek <monstr@...str.eu>, Ralf Baechle <ralf@...ux-mips.org>, Paul Burton <paulburton@...nel.org>, Nick Hu <nickhu@...estech.com>, Ley Foon Tan <ley.foon.tan@...el.com>, Jonas Bonn <jonas@...thpole.se>, "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>, Michael Ellerman <mpe@...erman.id.au>, Paul Walmsley <paul.walmsley@...ive.com>, Heiko Carstens <heiko.carstens@...ibm.com>, Rich Felker <dalias@...c.org>, "David S. Miller" <davem@...emloft.net>, Guan Xuetao <gxt@....edu.cn>, Thomas Gleixner <tglx@...utronix.de>, Jeff Dike <jdike@...toit.com>, Chris Zankel <chris@...kel.net>, Andrew Morton <akpm@...ux-foundation.org>, linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org, linux-snps-arc@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org, linux-c6x-dev@...ux-c6x.org, uclinux-h8-devel@...ts.sourceforge.jp, linux-hexagon@...r.kernel.org, linux-ia64@...r.kernel.org, linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org, nios2-dev@...ts.rocketboards.org, openrisc@...ts.librecores.org, linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org, linux-sh@...r.kernel.org, sparclinux@...r.kernel.org, linux-um@...ts.infradead.org, linux-xtensa@...ux-xtensa.org Subject: Re: [RFC 1/3] mm/vma: Define a default value for VM_DATA_DEFAULT_FLAGS On 03/03/2020 10:55 PM, Vlastimil Babka wrote: > On 3/2/20 7:47 AM, Anshuman Khandual wrote: >> There are many platforms with exact same value for VM_DATA_DEFAULT_FLAGS >> This creates a default value for VM_DATA_DEFAULT_FLAGS in line with the >> existing VM_STACK_DEFAULT_FLAGS. While here, also define some more macros >> with standard VMA access flag combinations that are used frequently across >> many platforms. Apart from simplification, this reduces code duplication >> as well. >> >> Cc: Richard Henderson <rth@...ddle.net> >> Cc: Vineet Gupta <vgupta@...opsys.com> >> Cc: Russell King <linux@...linux.org.uk> >> Cc: Catalin Marinas <catalin.marinas@....com> >> Cc: Mark Salter <msalter@...hat.com> >> Cc: Guo Ren <guoren@...nel.org> >> Cc: Yoshinori Sato <ysato@...rs.sourceforge.jp> >> Cc: Brian Cain <bcain@...eaurora.org> >> Cc: Tony Luck <tony.luck@...el.com> >> Cc: Geert Uytterhoeven <geert@...ux-m68k.org> >> Cc: Michal Simek <monstr@...str.eu> >> Cc: Ralf Baechle <ralf@...ux-mips.org> >> Cc: Paul Burton <paulburton@...nel.org> >> Cc: Nick Hu <nickhu@...estech.com> >> Cc: Ley Foon Tan <ley.foon.tan@...el.com> >> Cc: Jonas Bonn <jonas@...thpole.se> >> Cc: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com> >> Cc: Michael Ellerman <mpe@...erman.id.au> >> Cc: Paul Walmsley <paul.walmsley@...ive.com> >> Cc: Heiko Carstens <heiko.carstens@...ibm.com> >> Cc: Rich Felker <dalias@...c.org> >> Cc: "David S. Miller" <davem@...emloft.net> >> Cc: Guan Xuetao <gxt@....edu.cn> >> Cc: Thomas Gleixner <tglx@...utronix.de> >> Cc: Jeff Dike <jdike@...toit.com> >> Cc: Chris Zankel <chris@...kel.net> >> Cc: Andrew Morton <akpm@...ux-foundation.org> >> Cc: linux-alpha@...r.kernel.org >> Cc: linux-kernel@...r.kernel.org >> Cc: linux-snps-arc@...ts.infradead.org >> Cc: linux-arm-kernel@...ts.infradead.org >> Cc: linux-c6x-dev@...ux-c6x.org >> Cc: uclinux-h8-devel@...ts.sourceforge.jp >> Cc: linux-hexagon@...r.kernel.org >> Cc: linux-ia64@...r.kernel.org >> Cc: linux-m68k@...ts.linux-m68k.org >> Cc: linux-mips@...r.kernel.org >> Cc: nios2-dev@...ts.rocketboards.org >> Cc: openrisc@...ts.librecores.org >> Cc: linux-parisc@...r.kernel.org >> Cc: linuxppc-dev@...ts.ozlabs.org >> Cc: linux-riscv@...ts.infradead.org >> Cc: linux-s390@...r.kernel.org >> Cc: linux-sh@...r.kernel.org >> Cc: sparclinux@...r.kernel.org >> Cc: linux-um@...ts.infradead.org >> Cc: linux-xtensa@...ux-xtensa.org >> Cc: linux-mm@...ck.org >> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com > Reviewed-by: Vlastimil Babka <vbabka@...e.cz> > > Nit: > >> diff --git a/include/linux/mm.h b/include/linux/mm.h >> index b0e53ef13ff1..7a764ae6ab68 100644 >> --- a/include/linux/mm.h >> +++ b/include/linux/mm.h >> @@ -342,6 +342,21 @@ extern unsigned int kobjsize(const void *objp); >> /* Bits set in the VMA until the stack is in its final location */ >> #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ) >> >> +#define TASK_EXEC ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) >> + >> +/* Common data flag combinations */ >> +#define VM_DATA_FLAGS_TSK_EXEC (VM_READ | VM_WRITE | TASK_EXEC | \ >> + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) >> +#define VM_DATA_FLAGS_NON_EXEC (VM_READ | VM_WRITE | VM_MAYREAD | \ >> + VM_MAYWRITE | VM_MAYEXEC) >> +#define VM_DATA_FLAGS_EXEC (VM_READ | VM_WRITE | VM_EXEC | \ >> + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) >> + >> +#ifndef VM_DATA_DEFAULT_FLAGS /* arch can override this */ >> +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ >> + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) > > Should you use VM_DATA_FLAGS_EXEC here? Yeah one more macro to expand, but it's > right above this. Sure, can do that. > >> +#endif >> + >> #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ >> #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS >> #endif >> > > >
Powered by blists - more mailing lists