summaryrefslogtreecommitdiffstats
path: root/arch/frv/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-06 18:23:17 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-07 03:16:02 +0100
commit04e4f2b18c8de1389d1e00fef0f42a8099910daf (patch)
treecd1ae20d055552a7ea9b9a21ee01a052589a66f5 /arch/frv/include
parentMerge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linux (diff)
downloadlinux-04e4f2b18c8de1389d1e00fef0f42a8099910daf.tar.xz
linux-04e4f2b18c8de1389d1e00fef0f42a8099910daf.zip
FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack
The current code will load the stack size and protection markings, but then only use the markings in the MMU code path. The NOMMU code path always passes PROT_EXEC to the mmap() call. While this doesn't matter to most people whilst the code is running, it will cause a pointless icache flush when starting every FDPIC application. Typically this icache flush will be of a region on the order of 128KB in size, or may be the entire icache, depending on the facilities available on the CPU. In the case where the arch default behaviour seems to be desired (EXSTACK_DEFAULT), we probe VM_STACK_FLAGS for VM_EXEC to determine whether we should be setting PROT_EXEC or not. For arches that support an MPU (Memory Protection Unit - an MMU without the virtual mapping capability), setting PROT_EXEC or not will make an important difference. It should be noted that this change also affects the executability of the brk region, since ELF-FDPIC has that share with the stack. However, this is probably irrelevant as NOMMU programs aren't likely to use the brk region, preferring instead allocation via mmap(). Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/frv/include')
-rw-r--r--arch/frv/include/asm/page.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/frv/include/asm/page.h b/arch/frv/include/asm/page.h
index 25c6a5002355..8c97068ac8fc 100644
--- a/arch/frv/include/asm/page.h
+++ b/arch/frv/include/asm/page.h
@@ -63,12 +63,10 @@ extern unsigned long max_pfn;
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
-#ifdef CONFIG_MMU
#define VM_DATA_DEFAULT_FLAGS \
(VM_READ | VM_WRITE | \
((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-#endif
#endif /* __ASSEMBLY__ */