summaryrefslogtreecommitdiffstats
path: root/sys/syscall_untyped.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/syscall_untyped.c')
-rw-r--r--sys/syscall_untyped.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/syscall_untyped.c b/sys/syscall_untyped.c
index 1ec21c7..c4378ea 100644
--- a/sys/syscall_untyped.c
+++ b/sys/syscall_untyped.c
@@ -1,8 +1,11 @@
+#include "api/process.h"
#include "arch/x86_64/hal/obj.h"
#include "hal/memory.h"
+#include "hal/obj.h"
#include "jove.h"
#include "lib/printf.h"
#include "proc/process.h"
+#include "sys/objdir.h"
#include "syscall.h"
static int
@@ -91,6 +94,10 @@ s_syscall_untyped_retype_pcb(jove_owned_obj_t *untyped_obj,
return -errno;
}
CHECK_OBJPERM(objdir_obj, JOVE_PERM_ALL, "New PCB needs full access to it's root objdir!");
+ if(!objdir_compare(objdir_obj.obj, PCB_ROOTDIR_SELF_I, obj_asunowned(untyped_obj))) {
+ klogf("Untyped is not in objdir entry %i\n", PCB_ROOTDIR_SELF_I);
+ return -EBADPATH;
+ }
obj_settype(untyped_obj, JOVE_OBJ_PCB);
return pcb_new(untyped_obj, untyped->limit, objdir_obj.obj);