summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-08-27 04:04:46 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-08-27 04:04:46 +0200
commitd25ca13ed8acdf609329055ef9c36d0f3fae9503 (patch)
tree2d935119e40f2eac523bf07149bc7ebd4a74a23e
parent1e773c97e79d74983edd9b46694956f76b0c7fd5 (diff)
kernel: make user stack segment non-executable
-rw-r--r--sys/src/9/port/sysproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c
index 56dc793d6..259b2d891 100644
--- a/sys/src/9/port/sysproc.c
+++ b/sys/src/9/port/sysproc.c
@@ -429,7 +429,7 @@ sysexec(va_list list)
if(tstk <= USTKSIZE)
error(Enovmem);
} while((s = isoverlap(tstk-USTKSIZE, USTKSIZE)) != nil);
- up->seg[ESEG] = newseg(SG_STACK, tstk-USTKSIZE, USTKSIZE/BY2PG);
+ up->seg[ESEG] = newseg(SG_STACK | SG_NOEXEC, tstk-USTKSIZE, USTKSIZE/BY2PG);
/*
* Args: pass 2: assemble; the pages will be faulted in