mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
linux: make ptrace(2) return EIO when trying to peek invalid address
Previously we've returned the error from native ptrace(2), ENOMEM. This confused Linux strace(2). Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29925
This commit is contained in:
parent
a9b66dbd91
commit
77651151f3
@ -313,6 +313,8 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data)
|
||||
error = kern_ptrace(td, PT_READ_I, pid, addr, 0);
|
||||
if (error == 0)
|
||||
error = copyout(td->td_retval, data, sizeof(l_int));
|
||||
else if (error == ENOMEM)
|
||||
error = EIO;
|
||||
td->td_retval[0] = error;
|
||||
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user