summaryrefslogtreecommitdiffstats
path: root/sys/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/syscall.c')
-rw-r--r--sys/syscall.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/syscall.c b/sys/syscall.c
index 0c40418..7d43d66 100644
--- a/sys/syscall.c
+++ b/sys/syscall.c
@@ -116,6 +116,12 @@ syscall_handler(uintmax_t message_path_raw, uint16_t message_pathlen)
jove_owned_obj_t *pagedir = lockstack_push(&ctx.lockstack, pcb_getpagedir(ctx.objdir));
uintptr_t message_vptr = message_unmap(ctx.message.obj, pagedir);
+ if(message_vptr == 0) {
+ klogf("Process %i tried to call syscall with unmapped message %P\n",
+ pcb_getpid(pcb), message_path, message_pathlen);
+ sysret = -EBADOBJ;
+ goto release_return;
+ }
size_t messagelen = 0x1000;
void *messagedata = (void*)message_getdata(ctx.message.obj);
@@ -160,7 +166,7 @@ fail_target_busy:
sysret = _syscall_handle_switch(&ctx);
remap_return:
- message_remap(ctx.message.obj, pagedir, message_vptr);
+ message_map(ctx.message.obj, pagedir, message_vptr);
release_return:
lockstack_popall(&ctx.lockstack);