diff options
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 21b9cf2..be1a6c2 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -87,8 +87,9 @@ handle_t _syscall_open(const char __user *path, int len) { if (process_find_free_handle(process_current, 0) < 0) SYSCALL_RETURN(-1); - path_buf = virt_cpy2kmalloc(process_current->pages, path, len); + path_buf = kmalloc(len); if (!path_buf) goto fail; + if (!virt_cpy_from(process_current->pages, path_buf, path, len)) goto fail; len = path_simplify(path_buf, path_buf, len); if (len < 0) goto fail; @@ -127,9 +128,9 @@ int _syscall_mount(handle_t hid, const char __user *path, int len) { if (PATH_MAX < len) SYSCALL_RETURN(-1); - // copy the path to the kernel to simplify it - path_buf = virt_cpy2kmalloc(process_current->pages, path, len); + path_buf = kmalloc(len); if (!path_buf) goto fail; + if (!virt_cpy_from(process_current->pages, path_buf, path, len)) goto fail; len = path_simplify(path_buf, path_buf, len); if (len < 0) goto fail; |