diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-11-25 20:15:02 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-05 22:59:09 +0100 |
commit | 3e223185b3b6bf96b0b86a3be0ad626193ef85d4 (patch) | |
tree | 33a20a755b99d379404f0652ace88360ccc9cc99 /Userland/Libraries/LibC | |
parent | 6f37510a710d0a27941eb24b02c920524b0fc19c (diff) | |
download | serenity-3e223185b3b6bf96b0b86a3be0ad626193ef85d4.zip |
Kernel+strace: Remove unnecessary indirection for PEEK
Also, remove incomplete, superfluous check.
Incomplete, because only the byte at the provided address was checked;
this misses the last bytes of the "jerk page".
Superfluous, because it is already correctly checked by peek_user_data
(which calls copy_from_user).
The caller/tracer should not typically attempt to read non-userspace
addresses, we don't need to "hot-path" it either.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/sys/ptrace.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibC/sys/ptrace.cpp b/Userland/Libraries/LibC/sys/ptrace.cpp index e20f4ce1eb..61c3e41e12 100644 --- a/Userland/Libraries/LibC/sys/ptrace.cpp +++ b/Userland/Libraries/LibC/sys/ptrace.cpp @@ -18,12 +18,9 @@ long ptrace(int request, pid_t tid, void* addr, void* data) // by looking at errno rather than the return value. FlatPtr out_data; - Syscall::SC_ptrace_peek_params peek_params; auto is_peek_type = request == PT_PEEK || request == PT_PEEKDEBUG; if (is_peek_type) { - peek_params.address = reinterpret_cast<FlatPtr*>(addr); - peek_params.out_data = &out_data; - addr = &peek_params; + data = &out_data; } Syscall::SC_ptrace_params params { |