aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/load.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-09 13:10:03 +0200
committerMarvin Borner2021-04-09 13:10:03 +0200
commiteeb88df1d501ccec4737c18dddb7ca0a1176304f (patch)
treed36b563a27a4a7bdeae662eb5aa44ca082b57e0b /kernel/features/load.c
parentf8d841fe268ebba43686729af535e035702438f7 (diff)
Added readable/writable checks
Diffstat (limited to 'kernel/features/load.c')
-rw-r--r--kernel/features/load.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/features/load.c b/kernel/features/load.c
index 91954b1..df01e04 100644
--- a/kernel/features/load.c
+++ b/kernel/features/load.c
@@ -11,7 +11,7 @@
res elf_load(const char *name, struct proc *proc)
{
- if (!memory_valid(name))
+ if (!memory_readable(name))
return -EFAULT;
stac();
@@ -52,7 +52,7 @@ res elf_load(const char *name, struct proc *proc)
header.version != 1 || header.machine != ELF_MACHINE_386)
return -ENOEXEC;
- if (!memory_valid((void *)header.entry))
+ if (!memory_is_user((void *)header.entry))
return -ENOEXEC;
// ASLR
@@ -77,7 +77,7 @@ res elf_load(const char *name, struct proc *proc)
if (program.vaddr == 0 || program.type != ELF_PROGRAM_TYPE_LOAD)
continue;
- if (!memory_is_user(program.vaddr))
+ if (!memory_is_user((void *)program.vaddr))
return -ENOEXEC;
struct page_dir *prev;