summaryrefslogtreecommitdiff
path: root/Kernel/Ptrace.cpp
AgeCommit message (Collapse)Author
2020-05-09Kernel: Add missing copyright header to Ptrace.cppLinus Groh
2020-04-14Kernel: Remove SmapDisablers in sys$ptrace() implementationAndreas Kling
Instead, use copy_from_user() or copy_to_user() which does additional verification and will panic the kernel on attempted kernel access.
2020-04-14Kernel: Fix little mistakes in ptrace(PT_PEEK)Andreas Kling
Output address validation should be done for the tracer's address space and not the tracee's. Also use copy_to_user() instead of copy_from_user(). The two are really identical at the moment, but maybe we can add some assertions to make sure we're doing what we think we're doing. Thanks to Sergey for spotting these!
2020-04-13Kernel: Don't ignore validation result in ptrace(PT_PEEK)Andreas Kling
Also mark all of the address validation functions [[nodiscard]] to turn this kind of bug into a compile error in the future.
2020-04-13Kernel: Use copy_from_user() in ptrace(PT_PEEK)Andreas Kling
2020-04-13ptrace: Report error in PT_PEEK via errnoItamar
The syscall wrapper for ptrace needs to return the peeked value when using PT_PEEK. Because of this, the user has to check errno to detect an error in PT_PEEK. This commit changes the actual syscall's interface (only for PT_PEEK) to allow the syscall wrapper to detect an error and change errno.
2020-04-13ptrace: Add PT_SETREGSItamar
PT_SETTREGS sets the regsiters of the traced thread. It can only be used when the tracee is stopped. Also, refactor ptrace. The implementation was getting long and cluttered the alraedy large Process.cpp file. This commit moves the bulk of the implementation to Kernel/Ptrace.cpp, and factors out peek & poke to separate methods of the Process class.