inaccessible page under the user stack page, to help exec deal w/ too-large args
This commit is contained in:
parent
62e3b8a92c
commit
371ab7fa96
4 changed files with 21 additions and 4 deletions
13
vm.c
13
vm.c
|
|
@ -363,3 +363,16 @@ copyout(pde_t *pgdir, uint va, void *p, uint len)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Clear PTE_U on a page. Used to create an inaccessible
|
||||
// page beneath the user stack.
|
||||
void
|
||||
clear_pte_u(pde_t *pgdir, char *uva)
|
||||
{
|
||||
pte_t *pte;
|
||||
|
||||
pte = walkpgdir(pgdir, uva, 0);
|
||||
if(pte == 0)
|
||||
panic("clear_pte_u");
|
||||
*pte &= ~PTE_U;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue