Kernel: Disable big process lock in sys$gethostname() sys$sethostname()

This commit is contained in:
Brian Gianforcaro 2021-07-18 11:27:13 -07:00 committed by Gunnar Beutner
parent 9201a06027
commit 10ce896d4f
Notes: sideshowbarker 2024-07-18 08:42:43 +09:00
2 changed files with 4 additions and 4 deletions

View file

@ -64,8 +64,8 @@ enum class NeedsBigProcessLock {
S(get_dir_entries, NeedsBigProcessLock::Yes) \
S(getcwd, NeedsBigProcessLock::Yes) \
S(gettimeofday, NeedsBigProcessLock::Yes) \
S(gethostname, NeedsBigProcessLock::Yes) \
S(sethostname, NeedsBigProcessLock::Yes) \
S(gethostname, NeedsBigProcessLock::No) \
S(sethostname, NeedsBigProcessLock::No) \
S(chdir, NeedsBigProcessLock::Yes) \
S(uname, NeedsBigProcessLock::Yes) \
S(set_mmap_name, NeedsBigProcessLock::Yes) \

View file

@ -13,7 +13,7 @@ extern Mutex* g_hostname_lock;
KResultOr<FlatPtr> Process::sys$gethostname(Userspace<char*> buffer, size_t size)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
VERIFY_NO_PROCESS_BIG_LOCK(this)
REQUIRE_PROMISE(stdio);
if (size > NumericLimits<ssize_t>::max())
return EINVAL;
@ -27,7 +27,7 @@ KResultOr<FlatPtr> Process::sys$gethostname(Userspace<char*> buffer, size_t size
KResultOr<FlatPtr> Process::sys$sethostname(Userspace<const char*> hostname, size_t length)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
VERIFY_NO_PROCESS_BIG_LOCK(this)
REQUIRE_NO_PROMISES;
if (!is_superuser())
return EPERM;