PTRACE_PEEKDATA consolidation
Identical implementations of PTRACE_PEEKDATA go into generic_ptrace_peekdata() function. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
bcdcd8e725
commit
7664732315
@ -153,7 +153,6 @@ static int ptrace_setregs(struct task_struct *tsk, const void __user *uregs)
|
||||
|
||||
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
|
||||
{
|
||||
unsigned long tmp;
|
||||
int ret;
|
||||
|
||||
pr_debug("arch_ptrace(%ld, %d, %#lx, %#lx)\n",
|
||||
@ -166,11 +165,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
|
||||
/* Read the word at location addr in the child process */
|
||||
case PTRACE_PEEKTEXT:
|
||||
case PTRACE_PEEKDATA:
|
||||
ret = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
|
||||
if (ret == sizeof(tmp))
|
||||
ret = put_user(tmp, (unsigned long __user *)data);
|
||||
else
|
||||
ret = -EIO;
|
||||
ret = generic_ptrace_peekdata(child, addr, data);
|
||||
break;
|
||||
|
||||
case PTRACE_PEEKUSR:
|
||||
|
Reference in New Issue
Block a user