diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-05-13 23:52:56 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-06-07 22:43:36 -0400 |
commit | e08f457c7c0cc7720f28349f8780ea752c063441 (patch) | |
tree | 7b82666f2002d57dc57d022daf90c778265159e9 /arch/sh | |
parent | 7a302a9674593259866de4a9d5ae8edc03dc1934 (diff) |
sh: __user annotations for __get/__put_user().
This adds in some more __user annotations. These weren't being
handled properly in some of the __get_user and __put_user paths,
so tidy those up.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/process.c | 12 | ||||
-rw-r--r-- | arch/sh/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/sh/kernel/signal.c | 4 | ||||
-rw-r--r-- | arch/sh/kernel/traps.c | 2 |
4 files changed, 12 insertions, 14 deletions
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index a11e2aa73cbc..aa9c8112140b 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kexec.h> | 17 | #include <linux/kexec.h> |
18 | #include <linux/kdebug.h> | 18 | #include <linux/kdebug.h> |
19 | #include <linux/tick.h> | 19 | #include <linux/tick.h> |
20 | #include <linux/reboot.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/mmu_context.h> | 22 | #include <asm/mmu_context.h> |
22 | #include <asm/pgalloc.h> | 23 | #include <asm/pgalloc.h> |
@@ -449,23 +450,20 @@ asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, | |||
449 | /* | 450 | /* |
450 | * sys_execve() executes a new program. | 451 | * sys_execve() executes a new program. |
451 | */ | 452 | */ |
452 | asmlinkage int sys_execve(char *ufilename, char **uargv, | 453 | asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv, |
453 | char **uenvp, unsigned long r7, | 454 | char __user * __user *uenvp, unsigned long r7, |
454 | struct pt_regs __regs) | 455 | struct pt_regs __regs) |
455 | { | 456 | { |
456 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | 457 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); |
457 | int error; | 458 | int error; |
458 | char *filename; | 459 | char *filename; |
459 | 460 | ||
460 | filename = getname((char __user *)ufilename); | 461 | filename = getname(ufilename); |
461 | error = PTR_ERR(filename); | 462 | error = PTR_ERR(filename); |
462 | if (IS_ERR(filename)) | 463 | if (IS_ERR(filename)) |
463 | goto out; | 464 | goto out; |
464 | 465 | ||
465 | error = do_execve(filename, | 466 | error = do_execve(filename, uargv, uenvp, regs); |
466 | (char __user * __user *)uargv, | ||
467 | (char __user * __user *)uenvp, | ||
468 | regs); | ||
469 | if (error == 0) { | 467 | if (error == 0) { |
470 | task_lock(current); | 468 | task_lock(current); |
471 | current->ptrace &= ~PT_DTRACE; | 469 | current->ptrace &= ~PT_DTRACE; |
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 3fb5fc0b550d..f2eaa485d04d 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c | |||
@@ -99,7 +99,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
99 | ret = -EIO; | 99 | ret = -EIO; |
100 | if (copied != sizeof(tmp)) | 100 | if (copied != sizeof(tmp)) |
101 | break; | 101 | break; |
102 | ret = put_user(tmp,(unsigned long *) data); | 102 | ret = put_user(tmp,(unsigned long __user *) data); |
103 | break; | 103 | break; |
104 | } | 104 | } |
105 | 105 | ||
@@ -128,7 +128,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
128 | tmp = !!tsk_used_math(child); | 128 | tmp = !!tsk_used_math(child); |
129 | else | 129 | else |
130 | tmp = 0; | 130 | tmp = 0; |
131 | ret = put_user(tmp, (unsigned long *)data); | 131 | ret = put_user(tmp, (unsigned long __user *)data); |
132 | break; | 132 | break; |
133 | } | 133 | } |
134 | 134 | ||
@@ -196,7 +196,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
196 | 196 | ||
197 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | 197 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ |
198 | long pc; | 198 | long pc; |
199 | struct pt_regs *dummy = NULL; | 199 | struct pt_regs *regs = NULL; |
200 | 200 | ||
201 | ret = -EIO; | 201 | ret = -EIO; |
202 | if (!valid_signal(data)) | 202 | if (!valid_signal(data)) |
@@ -207,7 +207,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
207 | child->ptrace |= PT_DTRACE; | 207 | child->ptrace |= PT_DTRACE; |
208 | } | 208 | } |
209 | 209 | ||
210 | pc = get_stack_long(child, (long)&dummy->pc); | 210 | pc = get_stack_long(child, (long)®s->pc); |
211 | 211 | ||
212 | /* Next scheduling will set up UBC */ | 212 | /* Next scheduling will set up UBC */ |
213 | if (child->thread.ubc_pc == 0) | 213 | if (child->thread.ubc_pc == 0) |
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index b32c35a7c0a3..4fc5b402b21b 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c | |||
@@ -261,14 +261,14 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
261 | goto badframe; | 261 | goto badframe; |
262 | /* It is more difficult to avoid calling this function than to | 262 | /* It is more difficult to avoid calling this function than to |
263 | call it and ignore errors. */ | 263 | call it and ignore errors. */ |
264 | do_sigaltstack(&st, NULL, regs->regs[15]); | 264 | do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame); |
265 | 265 | ||
266 | return r0; | 266 | return r0; |
267 | 267 | ||
268 | badframe: | 268 | badframe: |
269 | force_sig(SIGSEGV, current); | 269 | force_sig(SIGSEGV, current); |
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
274 | * Set up a signal frame. | 274 | * Set up a signal frame. |
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index 5b75cb6f8f9b..299b8cf0f512 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
@@ -581,7 +581,7 @@ uspace_segv: | |||
581 | info.si_signo = SIGBUS; | 581 | info.si_signo = SIGBUS; |
582 | info.si_errno = 0; | 582 | info.si_errno = 0; |
583 | info.si_code = si_code; | 583 | info.si_code = si_code; |
584 | info.si_addr = (void *) address; | 584 | info.si_addr = (void __user *)address; |
585 | force_sig_info(SIGBUS, &info, current); | 585 | force_sig_info(SIGBUS, &info, current); |
586 | } else { | 586 | } else { |
587 | if (regs->pc & 1) | 587 | if (regs->pc & 1) |