Commit 517a72df authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[SPARC]: __user annotations around sparc{32,64} ptrace ...succ_return...()

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 459e48b9
...@@ -48,9 +48,9 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value) ...@@ -48,9 +48,9 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
} }
static void static void
pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long __user *addr)
{ {
if (put_user(value, (long __user *) addr)) { if (put_user(value, addr)) {
pt_error_return(regs, EFAULT); pt_error_return(regs, EFAULT);
return; return;
} }
...@@ -61,7 +61,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) ...@@ -61,7 +61,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
} }
static void static void
pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) pt_os_succ_return (struct pt_regs *regs, unsigned long val, long __user *addr)
{ {
if (current->personality == PER_SUNOS) if (current->personality == PER_SUNOS)
pt_succ_return (regs, val); pt_succ_return (regs, val);
...@@ -71,7 +71,7 @@ pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) ...@@ -71,7 +71,7 @@ pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr)
/* Fuck me gently with a chainsaw... */ /* Fuck me gently with a chainsaw... */
static inline void read_sunos_user(struct pt_regs *regs, unsigned long offset, static inline void read_sunos_user(struct pt_regs *regs, unsigned long offset,
struct task_struct *tsk, long *addr) struct task_struct *tsk, long __user *addr)
{ {
struct pt_regs *cregs = tsk->thread.kregs; struct pt_regs *cregs = tsk->thread.kregs;
struct thread_info *t = tsk->thread_info; struct thread_info *t = tsk->thread_info;
...@@ -345,14 +345,14 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -345,14 +345,14 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
if (access_process_vm(child, addr, if (access_process_vm(child, addr,
&tmp, sizeof(tmp), 0) == sizeof(tmp)) &tmp, sizeof(tmp), 0) == sizeof(tmp))
pt_os_succ_return(regs, tmp, (long *)data); pt_os_succ_return(regs, tmp, (long __user *)data);
else else
pt_error_return(regs, EIO); pt_error_return(regs, EIO);
goto out_tsk; goto out_tsk;
} }
case PTRACE_PEEKUSR: case PTRACE_PEEKUSR:
read_sunos_user(regs, addr, child, (long *) data); read_sunos_user(regs, addr, child, (long __user *) data);
goto out_tsk; goto out_tsk;
case PTRACE_POKEUSR: case PTRACE_POKEUSR:
......
...@@ -50,7 +50,7 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value) ...@@ -50,7 +50,7 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
} }
static inline void static inline void
pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) pt_succ_return_linux(struct pt_regs *regs, unsigned long value, void __user *addr)
{ {
if (test_thread_flag(TIF_32BIT)) { if (test_thread_flag(TIF_32BIT)) {
if (put_user(value, (unsigned int __user *) addr)) { if (put_user(value, (unsigned int __user *) addr)) {
...@@ -70,7 +70,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr) ...@@ -70,7 +70,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
} }
static void static void
pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr) pt_os_succ_return (struct pt_regs *regs, unsigned long val, void __user *addr)
{ {
if (current->personality == PER_SUNOS) if (current->personality == PER_SUNOS)
pt_succ_return (regs, val); pt_succ_return (regs, val);
...@@ -226,7 +226,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -226,7 +226,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
if (res < 0) if (res < 0)
pt_error_return(regs, -res); pt_error_return(regs, -res);
else else
pt_os_succ_return(regs, tmp64, (long *) data); pt_os_succ_return(regs, tmp64, (void __user *) data);
goto flush_and_out; goto flush_and_out;
} }
......
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