1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

Kernel: No lock validate_user_stack variant, switch to Space as argument

The entire process is not needed, just require the user to pass in the
Space. Also provide no_lock variant to use when you already have the
VM/Space lock acquired, to avoid unnecessary recursive spinlock
acquisitions.
This commit is contained in:
Brian Gianforcaro 2021-07-18 08:53:37 -07:00 committed by Gunnar Beutner
parent 59b6169b51
commit 308396bca1
5 changed files with 16 additions and 7 deletions

View file

@ -33,7 +33,7 @@ KResultOr<FlatPtr> Process::sys$create_thread(void* (*entry)(void*), Userspace<c
if (user_sp.has_overflow())
return EOVERFLOW;
if (!MM.validate_user_stack(*this, VirtualAddress(user_sp.value() - 4)))
if (!MM.validate_user_stack(this->space(), VirtualAddress(user_sp.value() - 4)))
return EFAULT;
// FIXME: return EAGAIN if Thread::all_threads().size() is greater than PTHREAD_THREADS_MAX