summaryrefslogtreecommitdiff
path: root/kernel/proc.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2022-08-12 13:22:10 -0400
committerFrans Kaashoek <[email protected]>2022-08-12 13:22:10 -0400
commit899cc02660232092209a5db57b326ab7b49813dd (patch)
treeabde95c343fb06294fba1c30036a3d6564602693 /kernel/proc.c
parent8f58cc7df99e9f697ca3843886802ecab5cb8991 (diff)
downloadxv6-labs-899cc02660232092209a5db57b326ab7b49813dd.tar.gz
xv6-labs-899cc02660232092209a5db57b326ab7b49813dd.tar.bz2
xv6-labs-899cc02660232092209a5db57b326ab7b49813dd.zip
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.
Diffstat (limited to 'kernel/proc.c')
-rw-r--r--kernel/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/proc.c b/kernel/proc.c
index 580b3b6..0fa6a2c 100644
--- a/kernel/proc.c
+++ b/kernel/proc.c
@@ -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){