linux: fix PTRACE_POKEDATA and PTRACE_POKETEXT.
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
7d3310c4fc
commit
47f7345bab
@ -594,10 +594,15 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
|
||||
error = linux_ptrace_peekuser(td, pid, addr, (void *)uap->data);
|
||||
break;
|
||||
case LINUX_PTRACE_POKETEXT:
|
||||
error = kern_ptrace(td, PT_WRITE_I, pid, addr, uap->data);
|
||||
break;
|
||||
case LINUX_PTRACE_POKEDATA:
|
||||
error = kern_ptrace(td, PT_WRITE_D, pid, addr, uap->data);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
/*
|
||||
* Linux expects this syscall to write 64 bits, not 32.
|
||||
*/
|
||||
error = kern_ptrace(td, PT_WRITE_D, pid,
|
||||
(void *)(uap->addr + 4), uap->data >> 32);
|
||||
break;
|
||||
case LINUX_PTRACE_POKEUSER:
|
||||
error = linux_ptrace_pokeuser(td, pid, addr, (void *)uap->data);
|
||||
|
Loading…
Reference in New Issue
Block a user