diff --git a/changelog/2653.fixed.md b/changelog/2653.fixed.md new file mode 100644 index 0000000000..fb2885671d --- /dev/null +++ b/changelog/2653.fixed.md @@ -0,0 +1 @@ +Fixed `nix::sys::ptrace::syscall_info`, which was not setting the `data` argument properly, causing garbage values to be returned. diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs index 8c1a46ba8d..d067ef5789 100644 --- a/src/sys/ptrace/linux.rs +++ b/src/sys/ptrace/linux.rs @@ -504,7 +504,7 @@ fn ptrace_get_data(request: Request, pid: Pid) -> Result { libc::ptrace( request as RequestType, libc::pid_t::from(pid), - ptr::null_mut::(), + std::mem::size_of::(), data.as_mut_ptr(), ) };