inaccessible page under the user stack page, to help exec deal w/ too-large args

This commit is contained in:
Robert Morris 2011-09-01 13:25:34 -04:00
parent 62e3b8a92c
commit 371ab7fa96
4 changed files with 21 additions and 4 deletions

13
vm.c
View file

@ -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;
}