[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 коммит произвёл Bryan Wu
Родитель 1307a65130
Коммит 0ddeeca25c
6 изменённых файлов: 20 добавлений и 17 удалений

Просмотреть файл

@ -202,7 +202,7 @@ copy_thread(int nr, unsigned long clone_flags,
* sys_execve() executes a new program. * 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; int error;
char *filename; char *filename;
@ -245,23 +245,25 @@ unsigned long get_wchan(struct task_struct *p)
void finish_atomic_sections (struct pt_regs *regs) 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) if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END)
return; return;
switch (regs->pc) { switch (regs->pc) {
case ATOMIC_XCHG32 + 2: case ATOMIC_XCHG32 + 2:
put_user(regs->r1, (int *)regs->p0); put_user(regs->r1, up0);
regs->pc += 2; regs->pc += 2;
break; break;
case ATOMIC_CAS32 + 2: case ATOMIC_CAS32 + 2:
case ATOMIC_CAS32 + 4: case ATOMIC_CAS32 + 4:
if (regs->r0 == regs->r1) if (regs->r0 == regs->r1)
put_user(regs->r2, (int *)regs->p0); put_user(regs->r2, up0);
regs->pc = ATOMIC_CAS32 + 8; regs->pc = ATOMIC_CAS32 + 8;
break; break;
case ATOMIC_CAS32 + 6: case ATOMIC_CAS32 + 6:
put_user(regs->r2, (int *)regs->p0); put_user(regs->r2, up0);
regs->pc += 2; regs->pc += 2;
break; break;
@ -269,7 +271,7 @@ void finish_atomic_sections (struct pt_regs *regs)
regs->r0 = regs->r1 + regs->r0; regs->r0 = regs->r1 + regs->r0;
/* fall through */ /* fall through */
case ATOMIC_ADD32 + 4: case ATOMIC_ADD32 + 4:
put_user(regs->r0, (int *)regs->p0); put_user(regs->r0, up0);
regs->pc = ATOMIC_ADD32 + 6; regs->pc = ATOMIC_ADD32 + 6;
break; break;
@ -277,7 +279,7 @@ void finish_atomic_sections (struct pt_regs *regs)
regs->r0 = regs->r1 - regs->r0; regs->r0 = regs->r1 - regs->r0;
/* fall through */ /* fall through */
case ATOMIC_SUB32 + 4: case ATOMIC_SUB32 + 4:
put_user(regs->r0, (int *)regs->p0); put_user(regs->r0, up0);
regs->pc = ATOMIC_SUB32 + 6; regs->pc = ATOMIC_SUB32 + 6;
break; break;
@ -285,7 +287,7 @@ void finish_atomic_sections (struct pt_regs *regs)
regs->r0 = regs->r1 | regs->r0; regs->r0 = regs->r1 | regs->r0;
/* fall through */ /* fall through */
case ATOMIC_IOR32 + 4: case ATOMIC_IOR32 + 4:
put_user(regs->r0, (int *)regs->p0); put_user(regs->r0, up0);
regs->pc = ATOMIC_IOR32 + 6; regs->pc = ATOMIC_IOR32 + 6;
break; break;
@ -293,7 +295,7 @@ void finish_atomic_sections (struct pt_regs *regs)
regs->r0 = regs->r1 & regs->r0; regs->r0 = regs->r1 & regs->r0;
/* fall through */ /* fall through */
case ATOMIC_AND32 + 4: case ATOMIC_AND32 + 4:
put_user(regs->r0, (int *)regs->p0); put_user(regs->r0, up0);
regs->pc = ATOMIC_AND32 + 6; regs->pc = ATOMIC_AND32 + 6;
break; break;
@ -301,7 +303,7 @@ void finish_atomic_sections (struct pt_regs *regs)
regs->r0 = regs->r1 ^ regs->r0; regs->r0 = regs->r1 ^ regs->r0;
/* fall through */ /* fall through */
case ATOMIC_XOR32 + 4: case ATOMIC_XOR32 + 4:
put_user(regs->r0, (int *)regs->p0); put_user(regs->r0, up0);
regs->pc = ATOMIC_XOR32 + 6; regs->pc = ATOMIC_XOR32 + 6;
break; break;
} }

Просмотреть файл

@ -193,6 +193,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
{ {
int ret; int ret;
int add = 0; int add = 0;
unsigned long __user *datap = (unsigned long __user *)data;
switch (request) { switch (request) {
/* when I and D space are separate, these will need to be fixed. */ /* 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); pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
if (copied != sizeof(tmp)) if (copied != sizeof(tmp))
break; break;
ret = put_user(tmp, (unsigned long *)data); ret = put_user(tmp, datap);
break; break;
} }
@ -263,7 +264,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
} else { } else {
tmp = get_reg(child, addr); tmp = get_reg(child, addr);
} }
ret = put_user(tmp, (unsigned long *)data); ret = put_user(tmp, datap);
break; 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. */ /* Get all gp regs from the child. */
ret = ptrace_getregs(child, (void __user *)data); ret = ptrace_getregs(child, datap);
break; break;
} }

Просмотреть файл

@ -55,13 +55,13 @@ struct rt_sigframe {
struct ucontext uc; 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()); return do_sigaltstack(uss, uoss, rdusp());
} }
static inline int 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; unsigned long usp = 0;
int err = 0; int err = 0;

Просмотреть файл

@ -49,7 +49,7 @@
* sys_pipe() is the normal C calling standard for creating * sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though. * 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 fd[2];
int error; int error;

Просмотреть файл

@ -506,7 +506,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
info.si_signo = sig; info.si_signo = sig;
info.si_errno = 0; info.si_errno = 0;
info.si_addr = (void *)fp->pc; info.si_addr = (void __user *)fp->pc;
force_sig_info(sig, &info, current); force_sig_info(sig, &info, current);
trace_buffer_restore(j); trace_buffer_restore(j);

Просмотреть файл

@ -143,7 +143,7 @@ struct sigaction {
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
typedef struct sigaltstack { typedef struct sigaltstack {
void *ss_sp; void __user *ss_sp;
int ss_flags; int ss_flags;
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;