mirror of
https://github.com/opnsense/src.git
synced 2026-07-15 12:11:48 -04:00
linux: Adjust PTRACE_GET_SYSCALL_INFO buffer size semantics
The tests/ptrace_syscall_info test from strace(1) complained
about this.
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D32368
(cherry picked from commit 75a9d95b4d)
This commit is contained in:
parent
4cae9d803a
commit
36ff5ce03c
1 changed files with 3 additions and 2 deletions
|
|
@ -558,7 +558,7 @@ linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data)
|
|||
|
||||
static int
|
||||
linux_ptrace_get_syscall_info(struct thread *td, pid_t pid,
|
||||
l_ulong addr, l_ulong data)
|
||||
l_ulong len, l_ulong data)
|
||||
{
|
||||
struct ptrace_lwpinfo lwpinfo;
|
||||
struct ptrace_sc_ret sr;
|
||||
|
|
@ -623,7 +623,8 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid,
|
|||
si.instruction_pointer = b_reg.r_rip;
|
||||
si.stack_pointer = b_reg.r_rsp;
|
||||
|
||||
error = copyout(&si, (void *)data, sizeof(si));
|
||||
len = MIN(len, sizeof(si));
|
||||
error = copyout(&si, (void *)data, len);
|
||||
if (error == 0)
|
||||
td->td_retval[0] = sizeof(si);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue