mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Disable big process lock in sys$gethostname() sys$sethostname()
This commit is contained in:
parent
9201a06027
commit
10ce896d4f
Notes:
sideshowbarker
2024-07-18 08:42:43 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/10ce896d4ff Pull-request: https://github.com/SerenityOS/serenity/pull/8864 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/gunnarbeutner ✅ Reviewed-by: https://github.com/tomuta ✅
2 changed files with 4 additions and 4 deletions
|
@ -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) \
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue