summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/ptrace.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 17:51:37 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 17:51:37 +0200
commit789db813d397f476452d2ecce140385e1600a8c7 (patch)
tree745f79aa8d3f3045983666183b307777da0325e5 /Kernel/Syscalls/ptrace.cpp
parentd7e5768763ff39201761e7c4dfb07cd18c724344 (diff)
downloadserenity-789db813d397f476452d2ecce140385e1600a8c7.zip
Kernel: Use copy_typed_from_user<T> for fetching syscall parameters
Diffstat (limited to 'Kernel/Syscalls/ptrace.cpp')
-rw-r--r--Kernel/Syscalls/ptrace.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/ptrace.cpp b/Kernel/Syscalls/ptrace.cpp
index ba491879a2..77854351ee 100644
--- a/Kernel/Syscalls/ptrace.cpp
+++ b/Kernel/Syscalls/ptrace.cpp
@@ -148,8 +148,8 @@ KResultOr<FlatPtr> Process::sys$ptrace(Userspace<const Syscall::SC_ptrace_params
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(ptrace);
- Syscall::SC_ptrace_params params {};
- TRY(copy_from_user(&params, user_params));
+ auto params = TRY(copy_typed_from_user(user_params));
+
auto result = handle_ptrace(params, *this);
return result.is_error() ? result.error().error() : result.value();
}