Experiment with being more precise setting permissions for user pages.

Growing adds R|W pages (without X).  Exec() marks the stack only R|W.

Probably could setup permissions for text and data better if we call
ld with --no-omagic instead of -N.
This commit is contained in:
Frans Kaashoek 2022-08-12 13:22:10 -04:00
parent 8f58cc7df9
commit 899cc02660
4 changed files with 6 additions and 6 deletions

View file

@ -264,7 +264,7 @@ growproc(int n)
sz = p->sz;
if(n > 0){
if((sz = uvmalloc(p->pagetable, sz, sz + n)) == 0) {
if((sz = uvmalloc(p->pagetable, sz, sz + n, PTE_W)) == 0) {
return -1;
}
} else if(n < 0){