Kernel: Make module_load() and module_unload() be superuser-only

These should just fail with EPERM if you're not the superuser.
This commit is contained in:
Andreas Kling 2020-01-01 00:45:03 +01:00
commit 14cdd3fdc1
Notes: sideshowbarker 2024-07-19 10:30:13 +09:00

View file

@ -3695,10 +3695,8 @@ int Process::sys$beep()
int Process::sys$module_load(const char* path, size_t path_length)
{
#if 0
if (!is_superuser())
return -EPERM;
#endif
if (!validate_read(path, path_length))
return -EFAULT;
auto description_or_error = VFS::the().open(path, 0, 0, current_directory());
@ -3814,10 +3812,8 @@ int Process::sys$module_load(const char* path, size_t path_length)
int Process::sys$module_unload(const char* name, size_t name_length)
{
#if 0
if (!is_superuser())
return -EPERM;
#endif
if (!validate_read(name, name_length))
return -EFAULT;