mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
ptrace: cleanup ptrace_request()
Use new 'datavp' and 'datalp' variables to remove unnecesary castings. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4abf986960
commit
9fed81dc40
@ -565,6 +565,8 @@ int ptrace_request(struct task_struct *child, long request,
|
|||||||
{
|
{
|
||||||
int ret = -EIO;
|
int ret = -EIO;
|
||||||
siginfo_t siginfo;
|
siginfo_t siginfo;
|
||||||
|
void __user *datavp = (void __user *) data;
|
||||||
|
unsigned long __user *datalp = datavp;
|
||||||
|
|
||||||
switch (request) {
|
switch (request) {
|
||||||
case PTRACE_PEEKTEXT:
|
case PTRACE_PEEKTEXT:
|
||||||
@ -581,19 +583,17 @@ int ptrace_request(struct task_struct *child, long request,
|
|||||||
ret = ptrace_setoptions(child, data);
|
ret = ptrace_setoptions(child, data);
|
||||||
break;
|
break;
|
||||||
case PTRACE_GETEVENTMSG:
|
case PTRACE_GETEVENTMSG:
|
||||||
ret = put_user(child->ptrace_message, (unsigned long __user *) data);
|
ret = put_user(child->ptrace_message, datalp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PTRACE_GETSIGINFO:
|
case PTRACE_GETSIGINFO:
|
||||||
ret = ptrace_getsiginfo(child, &siginfo);
|
ret = ptrace_getsiginfo(child, &siginfo);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = copy_siginfo_to_user((siginfo_t __user *) data,
|
ret = copy_siginfo_to_user(datavp, &siginfo);
|
||||||
&siginfo);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PTRACE_SETSIGINFO:
|
case PTRACE_SETSIGINFO:
|
||||||
if (copy_from_user(&siginfo, (siginfo_t __user *) data,
|
if (copy_from_user(&siginfo, datavp, sizeof siginfo))
|
||||||
sizeof siginfo))
|
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
else
|
else
|
||||||
ret = ptrace_setsiginfo(child, &siginfo);
|
ret = ptrace_setsiginfo(child, &siginfo);
|
||||||
@ -624,7 +624,7 @@ int ptrace_request(struct task_struct *child, long request,
|
|||||||
}
|
}
|
||||||
mmput(mm);
|
mmput(mm);
|
||||||
|
|
||||||
ret = put_user(tmp, (unsigned long __user *) data);
|
ret = put_user(tmp, datalp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -653,7 +653,7 @@ int ptrace_request(struct task_struct *child, long request,
|
|||||||
case PTRACE_SETREGSET:
|
case PTRACE_SETREGSET:
|
||||||
{
|
{
|
||||||
struct iovec kiov;
|
struct iovec kiov;
|
||||||
struct iovec __user *uiov = (struct iovec __user *) data;
|
struct iovec __user *uiov = datavp;
|
||||||
|
|
||||||
if (!access_ok(VERIFY_WRITE, uiov, sizeof(*uiov)))
|
if (!access_ok(VERIFY_WRITE, uiov, sizeof(*uiov)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user