[Blackfin] arch: add missing __user marking to ss_sp member of signalstack and a few userspace system functions

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
Mike Frysinger 2008-03-07 02:37:41 +08:00 committed by Bryan Wu
parent 1307a65130
commit 0ddeeca25c
6 changed files with 20 additions and 17 deletions

View 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;
}

View 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;
}

View 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;

View 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;

View 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);

View 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;