Kernel: Return EFAULT when the kernel believes the wstatus pointer is invalid
This commit is contained in:
parent
44bd93b8b4
commit
cd9ecc1746
@ -490,7 +490,13 @@ void sys_waitpid(Context* context, long pid, int* wstatus,
|
|||||||
*kwstatus = (int)(child->exit_status & 0xff);
|
*kwstatus = (int)(child->exit_status & 0xff);
|
||||||
release_user_ref(kwstatus);
|
release_user_ref(kwstatus);
|
||||||
}
|
}
|
||||||
else { kinfoln("wstatus ptr is invalid: %p", (void*)wstatus); }
|
else
|
||||||
|
{
|
||||||
|
kinfoln("wstatus ptr is invalid: %p", (void*)wstatus);
|
||||||
|
child->state = child->Exited;
|
||||||
|
context->rax = -EFAULT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
child->state = child->Exited;
|
child->state = child->Exited;
|
||||||
context->rax = (long)child->id;
|
context->rax = (long)child->id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user