kernel: make user stack segment non-executable

This commit is contained in:
cinap_lenrek 2019-08-27 04:04:46 +02:00
parent 1e773c97e7
commit d25ca13ed8

View file

@ -429,7 +429,7 @@ sysexec(va_list list)
if(tstk <= USTKSIZE) if(tstk <= USTKSIZE)
error(Enovmem); error(Enovmem);
} while((s = isoverlap(tstk-USTKSIZE, USTKSIZE)) != nil); } 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 * Args: pass 2: assemble; the pages will be faulted in