[Blackfin] arch: add missing __user marking to ss_sp member of signalstack and a...
authorMike Frysinger <vapier.adi@gmail.com>
Thu, 6 Mar 2008 18:37:41 +0000 (02:37 +0800)
committerBryan Wu <cooloney@kernel.org>
Thu, 6 Mar 2008 18:37:41 +0000 (02:37 +0800)
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/process.c
arch/blackfin/kernel/ptrace.c
arch/blackfin/kernel/signal.c
arch/blackfin/kernel/sys_bfin.c
arch/blackfin/kernel/traps.c
include/asm-blackfin/signal.h

index 6dedb2da8b67168f8ad74af0469e56426d9c6531..fb94cbeafad6b625bf9c6114641fd7c9634b4598 100644 (file)
@@ -202,7 +202,7 @@ copy_thread(int nr, unsigned long clone_flags,
  * sys_execve() executes a new program.
  */
 
-asmlinkage int sys_execve(char *name, char **argv, char **envp)
+asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp)
 {
        int error;
        char *filename;
@@ -245,23 +245,25 @@ unsigned long get_wchan(struct task_struct *p)
 
 void finish_atomic_sections (struct pt_regs *regs)
 {
+       int __user *up0 = (int __user *)&regs->p0;
+
        if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END)
                return;
 
        switch (regs->pc) {
        case ATOMIC_XCHG32 + 2:
-               put_user(regs->r1, (int *)regs->p0);
+               put_user(regs->r1, up0);
                regs->pc += 2;
                break;
 
        case ATOMIC_CAS32 + 2:
        case ATOMIC_CAS32 + 4:
                if (regs->r0 == regs->r1)
-                       put_user(regs->r2, (int *)regs->p0);
+                       put_user(regs->r2, up0);
                regs->pc = ATOMIC_CAS32 + 8;
                break;
        case ATOMIC_CAS32 + 6:
-               put_user(regs->r2, (int *)regs->p0);
+               put_user(regs->r2, up0);
                regs->pc += 2;
                break;
 
@@ -269,7 +271,7 @@ void finish_atomic_sections (struct pt_regs *regs)
                regs->r0 = regs->r1 + regs->r0;
                /* fall through */
        case ATOMIC_ADD32 + 4:
-               put_user(regs->r0, (int *)regs->p0);
+               put_user(regs->r0, up0);
                regs->pc = ATOMIC_ADD32 + 6;
                break;
 
@@ -277,7 +279,7 @@ void finish_atomic_sections (struct pt_regs *regs)
                regs->r0 = regs->r1 - regs->r0;
                /* fall through */
        case ATOMIC_SUB32 + 4:
-               put_user(regs->r0, (int *)regs->p0);
+               put_user(regs->r0, up0);
                regs->pc = ATOMIC_SUB32 + 6;
                break;
 
@@ -285,7 +287,7 @@ void finish_atomic_sections (struct pt_regs *regs)
                regs->r0 = regs->r1 | regs->r0;
                /* fall through */
        case ATOMIC_IOR32 + 4:
-               put_user(regs->r0, (int *)regs->p0);
+               put_user(regs->r0, up0);
                regs->pc = ATOMIC_IOR32 + 6;
                break;
 
@@ -293,7 +295,7 @@ void finish_atomic_sections (struct pt_regs *regs)
                regs->r0 = regs->r1 & regs->r0;
                /* fall through */
        case ATOMIC_AND32 + 4:
-               put_user(regs->r0, (int *)regs->p0);
+               put_user(regs->r0, up0);
                regs->pc = ATOMIC_AND32 + 6;
                break;
 
@@ -301,7 +303,7 @@ void finish_atomic_sections (struct pt_regs *regs)
                regs->r0 = regs->r1 ^ regs->r0;
                /* fall through */
        case ATOMIC_XOR32 + 4:
-               put_user(regs->r0, (int *)regs->p0);
+               put_user(regs->r0, up0);
                regs->pc = ATOMIC_XOR32 + 6;
                break;
        }
index 85caf9b711a16ff59eb069a42ee9fb29491a589b..b4f062c172c69042e192b73352c21805ef4a7abe 100644 (file)
@@ -193,6 +193,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 {
        int ret;
        int add = 0;
+       unsigned long __user *datap = (unsigned long __user *)data;
 
        switch (request) {
                /* when I and D space are separate, these will need to be fixed. */
@@ -229,7 +230,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
                        if (copied != sizeof(tmp))
                                break;
-                       ret = put_user(tmp, (unsigned long *)data);
+                       ret = put_user(tmp, datap);
                        break;
                }
 
@@ -263,7 +264,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        } else {
                                tmp = get_reg(child, addr);
                        }
-                       ret = put_user(tmp, (unsigned long *)data);
+                       ret = put_user(tmp, datap);
                        break;
                }
 
@@ -389,7 +390,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                {
 
                        /* Get all gp regs from the child. */
-                       ret = ptrace_getregs(child, (void __user *)data);
+                       ret = ptrace_getregs(child, datap);
                        break;
                }
 
index 5564c9588aa807bd3c0384c9b5256e205b1cd7bd..71cfcd28b39ff4c05b63d58be6b565c239eb2985 100644 (file)
@@ -55,13 +55,13 @@ struct rt_sigframe {
        struct ucontext uc;
 };
 
-asmlinkage int sys_sigaltstack(const stack_t * uss, stack_t * uoss)
+asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
 {
        return do_sigaltstack(uss, uoss, rdusp());
 }
 
 static inline int
-rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *pr0)
+rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0)
 {
        unsigned long usp = 0;
        int err = 0;
index abcd14817d0e4f1291f115e9bf12df16982397a9..efb7b25a2633be0c0c79971ec89ab3c9101153ed 100644 (file)
@@ -49,7 +49,7 @@
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way unix traditionally does this, though.
  */
-asmlinkage int sys_pipe(unsigned long *fildes)
+asmlinkage int sys_pipe(unsigned long __user *fildes)
 {
        int fd[2];
        int error;
index 56a67ab698c7a6a69cee1a04d20b72b1e1d7cd6d..e8e8f735c2368e5115c4b7393fdfd26fa23b9064 100644 (file)
@@ -506,7 +506,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
 
        info.si_signo = sig;
        info.si_errno = 0;
-       info.si_addr = (void *)fp->pc;
+       info.si_addr = (void __user *)fp->pc;
        force_sig_info(sig, &info, current);
 
        trace_buffer_restore(j);
index 0250429b736a1fe8a074cbc96f0860e0f1812b14..87951d25145813e183459d03a15bf7000da69408 100644 (file)
@@ -143,7 +143,7 @@ struct sigaction {
 #endif                         /* __KERNEL__ */
 
 typedef struct sigaltstack {
-       void *ss_sp;
+       void __user *ss_sp;
        int ss_flags;
        size_t ss_size;
 } stack_t;