On Alpha Linux, the mmap'd stack needs to be made executable because
authorwtc
Thu, 07 May 1998 05:07:25 +0000
changeset 97 5be9ccabb37eed7f2a6ff59407a25e088363ff04
parent 94 a9bdc4f521b44402f532ef07f6e29ab6fc11fd75
child 98 a40f22988c9894de4a309c6c8ad41c0108beffd2
push idunknown
push userunknown
push dateunknown
On Alpha Linux, the mmap'd stack needs to be made executable because setjmp/signal seem to put machine instructions on the stack. This fix is contributed by gatgul@voicenet.com (Uncle George).
pr/src/md/unix/unix.c
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -2799,16 +2799,24 @@ from_heap:
 		else {
 			seg->size = size;
 			seg->access = PR_SEGMENT_RDWR;
 		}
 		goto exit;
 	}
 
 	prot = PROT_READ|PROT_WRITE;
+	/*
+	 * On Alpha Linux, the user-level thread stack needs
+	 * to be made executable because longjmp/signal seem
+	 * to put machine instructions on the stack.
+	 */
+#if defined(LINUX) && defined(__alpha)
+	prot |= PROT_EXEC;
+#endif
 	rv = mmap((vaddr != 0) ? vaddr : lastaddr, size, prot,
 	    _MD_MMAP_FLAGS,
 	    _pr_zero_fd, 0);
 	if (rv == (void*)-1) {
 		goto from_heap;
 	}
 	lastaddr += size;
 	seg->vaddr = rv;