Kernel: Disable big process lock for sys$getrandom

This syscall doesn't touch any intra-process shared resources and
already holds the global kernel RNG lock so there's no reason to hold
the big lock.
This commit is contained in:
Idan Horowitz 2021-08-06 14:43:02 +03:00 committed by Andreas Kling
parent b1f4f6ee15
commit 48325e2959
Notes: sideshowbarker 2024-07-18 07:23:43 +09:00
2 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ enum class NeedsBigProcessLock {
S(realpath, NeedsBigProcessLock::Yes) \
S(get_process_name, NeedsBigProcessLock::Yes) \
S(fchdir, NeedsBigProcessLock::Yes) \
S(getrandom, NeedsBigProcessLock::Yes) \
S(getrandom, NeedsBigProcessLock::No) \
S(getkeymap, NeedsBigProcessLock::Yes) \
S(setkeymap, NeedsBigProcessLock::Yes) \
S(clock_gettime, NeedsBigProcessLock::Yes) \

View File

@ -15,7 +15,7 @@ namespace Kernel {
// do, we should be able of the caveats that Linux has dealt with.
KResultOr<FlatPtr> Process::sys$getrandom(Userspace<void*> buffer, size_t buffer_size, [[maybe_unused]] unsigned flags)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
VERIFY_NO_PROCESS_BIG_LOCK(this);
REQUIRE_PROMISE(stdio);
if (buffer_size > NumericLimits<ssize_t>::max())
return EINVAL;