aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-06-05 08:19:14 -0400
committerVineet Gupta <vgupta@synopsys.com>2013-06-22 09:53:20 -0400
commit3abc94480225677ea08af817d56edfb0df9e9b80 (patch)
tree364c3c03f33d3934f53621669aba62023d5a5633 /arch
parent2ed21dae021db1f9f988494ceee519290217520d (diff)
ARC: [mm] Make stack/heap Non-executable by default
1. For VM_EXEC based delayed dcache/icache flush, reduces the number of flushes. 2. Makes this security feature ON by default rather than OFF before. 3. Applications can use mprotect() to selectively override this. 4. ELF binaries have a GNU_STACK segment which can easily override the kernel default permissions. For nested-functions/trampolines, gcc already auto-enables executable stack in elf. Others needing this can use -Wl,-z,execstack option. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arc/Kconfig7
-rw-r--r--arch/arc/include/asm/page.h7
2 files changed, 1 insertions, 13 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 50862ac8ef35..4a0e54fc01b2 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -362,13 +362,6 @@ config ARC_MISALIGN_ACCESS
362 Use ONLY-IF-ABS-NECESSARY as it will be very slow and also can hide 362 Use ONLY-IF-ABS-NECESSARY as it will be very slow and also can hide
363 potential bugs in code 363 potential bugs in code
364 364
365config ARC_STACK_NONEXEC
366 bool "Make stack non-executable"
367 default n
368 help
369 To disable the execute permissions of stack/heap of processes
370 which are enabled by default.
371
372config HZ 365config HZ
373 int "Timer Frequency" 366 int "Timer Frequency"
374 default 100 367 default 100
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index ab84bf131fe1..9c8aa41e45c2 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -96,13 +96,8 @@ typedef unsigned long pgtable_t;
96 96
97#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 97#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
98 98
99/* Default Permissions for page, used in mmap.c */ 99/* Default Permissions for stack/heaps pages (Non Executable) */
100#ifdef CONFIG_ARC_STACK_NONEXEC
101#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) 100#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE)
102#else
103#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
104 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
105#endif
106 101
107#define WANT_PAGE_VIRTUAL 1 102#define WANT_PAGE_VIRTUAL 1
108 103