vmm: make sure there is a thread in the struct in the dealwithrequest call

This commit is contained in:
Matheus
2023-01-08 19:30:31 -03:00
parent c08644d7fb
commit e7467e5ce8
+5 -1
View File
@@ -639,7 +639,11 @@ bool vmm_allocnowat(void* addr, size_t mmuflags, size_t size){
// called by the page fault handler
int vmm_dealwithrequest(void* addr, long error, bool user){
if(!arch_getcls()->thread) // the fault happened before the scheduler was initialised.
return EFAULT;
if(user && addr > USER_SPACE_END)
return EFAULT;