Procinfo set to read-only
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 8 Feb 2010 19:23:13 +0000 (11:23 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 8 Feb 2010 19:23:13 +0000 (11:23 -0800)
If you have something you want RW to userspace, it belongs in PROCDATA,
not PROCINFO.

kern/src/env.c

index a3ac6fe..9260c43 100644 (file)
@@ -85,7 +85,7 @@ WRITES(e->env_pgdir, e->env_cr3, e->env_procinfo, e->env_procdata)
                goto env_setup_vm_error_d;
        for (int i = 0; i < PROCINFO_NUM_PAGES; i++) {
                if (page_insert(e->env_pgdir, kva2page((void*)e->env_procinfo + i *
-                               PGSIZE), (void*SNT)(UINFO + i*PGSIZE), PTE_USER_RW) < 0)
+                               PGSIZE), (void*SNT)(UINFO + i*PGSIZE), PTE_USER_RO) < 0)
                        goto env_setup_vm_error;
        }
        for (int i = 0; i < PROCDATA_NUM_PAGES; i++) {