Commit 0f95ec58 authored by Linus Torvalds's avatar Linus Torvalds

Annotate kernel/ptrace.c with user pointer information

parent 9fde1f47
...@@ -200,7 +200,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in ...@@ -200,7 +200,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
return buf - old_buf; return buf - old_buf;
} }
int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len) int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
{ {
int copied = 0; int copied = 0;
...@@ -225,7 +225,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int l ...@@ -225,7 +225,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int l
return copied; return copied;
} }
int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len) int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len)
{ {
int copied = 0; int copied = 0;
...@@ -278,19 +278,18 @@ static int ptrace_setoptions(struct task_struct *child, long data) ...@@ -278,19 +278,18 @@ static int ptrace_setoptions(struct task_struct *child, long data)
return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; return (data & ~PTRACE_O_MASK) ? -EINVAL : 0;
} }
static int ptrace_getsiginfo(struct task_struct *child, long data) static int ptrace_getsiginfo(struct task_struct *child, siginfo_t __user * data)
{ {
if (child->last_siginfo == NULL) if (child->last_siginfo == NULL)
return -EINVAL; return -EINVAL;
return copy_siginfo_to_user ((siginfo_t *) data, child->last_siginfo); return copy_siginfo_to_user(data, child->last_siginfo);
} }
static int ptrace_setsiginfo(struct task_struct *child, long data) static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
{ {
if (child->last_siginfo == NULL) if (child->last_siginfo == NULL)
return -EINVAL; return -EINVAL;
if (copy_from_user (child->last_siginfo, (siginfo_t *) data, if (copy_from_user(child->last_siginfo, data, sizeof (siginfo_t)) != 0)
sizeof (siginfo_t)) != 0)
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -308,13 +307,13 @@ int ptrace_request(struct task_struct *child, long request, ...@@ -308,13 +307,13 @@ 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 *) data); ret = put_user(child->ptrace_message, (unsigned long __user *) data);
break; break;
case PTRACE_GETSIGINFO: case PTRACE_GETSIGINFO:
ret = ptrace_getsiginfo(child, data); ret = ptrace_getsiginfo(child, (siginfo_t __user *) data);
break; break;
case PTRACE_SETSIGINFO: case PTRACE_SETSIGINFO:
ret = ptrace_setsiginfo(child, data); ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
break; break;
default: default:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment