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:
parent
8f58cc7df9
commit
899cc02660
4 changed files with 6 additions and 6 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue