Skip to content

Commit

Permalink
Kernel: Make module_load() and module_unload() be superuser-only
Browse files Browse the repository at this point in the history
These should just fail with EPERM if you're not the superuser.
  • Loading branch information
awesomekling committed Dec 31, 2019
1 parent 6af301e commit 14cdd3f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 14cdd3f

Please sign in to comment.