linux-uconsole/arch/blackfin
Mike Frysinger 944a638b7b FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack
commit 04e4f2b18c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-02-09 04:50:49 -08:00
..
boot kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
configs Blackfin: increase default async timings for parallel flashes 2009-09-16 22:10:42 -04:00
include/asm FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack 2010-02-09 04:50:49 -08:00
kernel untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
lib Blackfin: mass clean up of copyright/licensing info 2009-10-07 04:36:26 -04:00
mach-bf518 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf527 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf533 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf537 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf538 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf548 Blackfin: update anomaly lists 2009-11-25 02:35:37 -05:00
mach-bf561 Blackfin: work around testset anomaly 05000477 2009-11-25 02:35:39 -05:00
mach-common untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mm Blackfin: mass clean up of copyright/licensing info 2009-10-07 04:36:26 -04:00
oprofile Blackfin arch: remove hardware PM code, oprofile not use it 2009-01-07 23:14:39 +08:00
ADI_BSD.txt Blackfin: mass clean up of copyright/licensing info 2009-10-07 04:36:26 -04:00
Kconfig Blackfin: convert to GENERIC_HARDIRQS_NO__DO_IRQ 2009-10-08 00:58:20 -04:00
Kconfig.debug Blackfin: add some isram-driver self tests 2009-09-16 22:10:36 -04:00
Makefile kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00