summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-01-30 07:56:00 +0000
committerkib <kib@FreeBSD.org>2012-01-30 07:56:00 +0000
commit6392be1eb8b49cec1df260bcd8e95cb7ce44542c (patch)
tree1eda6d1470e00f85e847c4321121ff9a4259296b /sys/kern
parenta39b6a3bffcf6cca87ef96f29c24d81e39d0fa2d (diff)
downloadFreeBSD-src-6392be1eb8b49cec1df260bcd8e95cb7ce44542c.zip
FreeBSD-src-6392be1eb8b49cec1df260bcd8e95cb7ce44542c.tar.gz
Finally, try to enable the nxstacks on amd64 and powerpc64 for both 64bit
and 32bit ABIs. Also try to enable nxstacks for PAE/i386 when supported, and some variants of powerpc32. MFC after: 2 months (if ever)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 4da2ad78..bde590c 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -118,7 +118,12 @@ static int elf_legacy_coredump = 0;
SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW,
&elf_legacy_coredump, 0, "");
-static int __elfN(nxstack) = 0;
+int __elfN(nxstack) =
+#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */
+ 1;
+#else
+ 0;
+#endif
SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO,
nxstack, CTLFLAG_RW, &__elfN(nxstack), 0,
__XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": enable non-executable stack");
OpenPOWER on IntegriCloud