summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2020-08-09 12:11:13 -0700
committerAndreas Kling <kling@serenityos.org>2020-08-10 12:52:15 +0200
commit0f42463eabe7afd81f0f9a1fcb2a61afffb8faf8 (patch)
treef80cc29cebd0b07bf7b48693c58c3645f8cd60af /Kernel/Syscalls
parent025a2a3c5b5d8ba13f85f33773a2484f4e8d6b87 (diff)
downloadserenity-0f42463eabe7afd81f0f9a1fcb2a61afffb8faf8.zip
Kernel: Use Userspace<T> for the execve syscall
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/execve.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index 6e8b4ab5ab..93f56ee73a 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -544,7 +544,7 @@ int Process::exec(String path, Vector<String> arguments, Vector<String> environm
return 0;
}
-int Process::sys$execve(const Syscall::SC_execve_params* user_params)
+int Process::sys$execve(Userspace<const Syscall::SC_execve_params*> user_params)
{
REQUIRE_PROMISE(exec);
@@ -568,14 +568,14 @@ int Process::sys$execve(const Syscall::SC_execve_params* user_params)
path = path_arg.value();
}
- auto copy_user_strings = [&](const auto& list, auto& output) {
+ auto copy_user_strings = [this](const auto& list, auto& output) {
if (!list.length)
return true;
if (!validate_read_typed(list.strings, list.length))
return false;
Vector<Syscall::StringArgument, 32> strings;
strings.resize(list.length);
- copy_from_user(strings.data(), list.strings, list.length * sizeof(Syscall::StringArgument));
+ copy_from_user(strings.data(), list.strings.unsafe_userspace_ptr(), list.length * sizeof(Syscall::StringArgument));
for (size_t i = 0; i < list.length; ++i) {
auto string = validate_and_copy_string_from_user(strings[i]);
if (string.is_null())