summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2018-07-11 10:42:20 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-25 11:23:59 +0200
commit2ee7d6f173308488c4ea190cbedd435b2a166e46 (patch)
treecc3b3c5d6c3048e5797a47c466c1c3ff93a5b2bb /arch
parent3a80fb0d7752e6ae163d72736b9401076c7b75c9 (diff)
downloadlinux-stable-2ee7d6f173308488c4ea190cbedd435b2a166e46.tar.gz
linux-stable-2ee7d6f173308488c4ea190cbedd435b2a166e46.tar.bz2
linux-stable-2ee7d6f173308488c4ea190cbedd435b2a166e46.zip
ARC: mm: allow mprotect to make stack mappings executable
commit 93312b6da4df31e4102ce5420e6217135a16c7ea upstream. mprotect(EXEC) was failing for stack mappings as default vm flags was missing MAYEXEC. This was triggered by glibc test suite nptl/tst-execstack testcase What is surprising is that despite running LTP for years on, we didn't catch this issue as it lacks a directed test case. gcc dejagnu tests with nested functions also requiring exec stack work fine though because they rely on the GNU_STACK segment spit out by compiler and handled in kernel elf loader. This glibc case is different as the stack is non exec to begin with and a dlopen of shared lib with GNU_STACK segment triggers the exec stack proceedings using a mprotect(PROT_EXEC) which was broken. CC: stable@vger.kernel.org Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arc/include/asm/page.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 296c3426a6ad..ffb5f33475f1 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -105,7 +105,7 @@ typedef pte_t * pgtable_t;
#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))
/* Default Permissions for stack/heaps pages (Non Executable) */
-#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE)
+#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
#define WANT_PAGE_VIRTUAL 1