mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 20:07:34 +00:00
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:
parent
6af301edec
commit
14cdd3fdc1
1 changed files with 0 additions and 4 deletions
|
@ -3695,10 +3695,8 @@ int Process::sys$beep()
|
||||||
|
|
||||||
int Process::sys$module_load(const char* path, size_t path_length)
|
int Process::sys$module_load(const char* path, size_t path_length)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (!is_superuser())
|
if (!is_superuser())
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
#endif
|
|
||||||
if (!validate_read(path, path_length))
|
if (!validate_read(path, path_length))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
auto description_or_error = VFS::the().open(path, 0, 0, current_directory());
|
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)
|
int Process::sys$module_unload(const char* name, size_t name_length)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (!is_superuser())
|
if (!is_superuser())
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
#endif
|
|
||||||
if (!validate_read(name, name_length))
|
if (!validate_read(name, name_length))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue