aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-03-06 13:37:41 -0500
committerBryan Wu <cooloney@kernel.org>2008-03-06 13:37:41 -0500
commit0ddeeca25ce33686262459e2387f57bd09574e47 (patch)
treecd33798b51e358260e2089a97e9e3e3de6d8e02b /arch
parent1307a65130963b061fbaca308b228a0f693a4495 (diff)
[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>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/kernel/process.c20
-rw-r--r--arch/blackfin/kernel/ptrace.c7
-rw-r--r--arch/blackfin/kernel/signal.c4
-rw-r--r--arch/blackfin/kernel/sys_bfin.c2
-rw-r--r--arch/blackfin/kernel/traps.c2
5 files changed, 19 insertions, 16 deletions
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 6dedb2da8b67..fb94cbeafad6 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -202,7 +202,7 @@ copy_thread(int nr, unsigned long clone_flags,
202 * sys_execve() executes a new program. 202 * sys_execve() executes a new program.
203 */ 203 */
204 204
205asmlinkage int sys_execve(char *name, char **argv, char **envp) 205asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp)
206{ 206{
207 int error; 207 int error;
208 char *filename; 208 char *filename;
@@ -245,23 +245,25 @@ unsigned long get_wchan(struct task_struct *p)
245 245
246void finish_atomic_sections (struct pt_regs *regs) 246void finish_atomic_sections (struct pt_regs *regs)
247{ 247{
248 int __user *up0 = (int __user *)&regs->p0;
249
248 if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END) 250 if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END)
249 return; 251 return;
250 252
251 switch (regs->pc) { 253 switch (regs->pc) {
252 case ATOMIC_XCHG32 + 2: 254 case ATOMIC_XCHG32 + 2:
253 put_user(regs->r1, (int *)regs->p0); 255 put_user(regs->r1, up0);
254 regs->pc += 2; 256 regs->pc += 2;
255 break; 257 break;
256 258
257 case ATOMIC_CAS32 + 2: 259 case ATOMIC_CAS32 + 2:
258 case ATOMIC_CAS32 + 4: 260 case ATOMIC_CAS32 + 4:
259 if (regs->r0 == regs->r1) 261 if (regs->r0 == regs->r1)
260 put_user(regs->r2, (int *)regs->p0); 262 put_user(regs->r2, up0);
261 regs->pc = ATOMIC_CAS32 + 8; 263 regs->pc = ATOMIC_CAS32 + 8;
262 break; 264 break;
263 case ATOMIC_CAS32 + 6: 265 case ATOMIC_CAS32 + 6:
264 put_user(regs->r2, (int *)regs->p0); 266 put_user(regs->r2, up0);
265 regs->pc += 2; 267 regs->pc += 2;
266 break; 268 break;
267 269
@@ -269,7 +271,7 @@ void finish_atomic_sections (struct pt_regs *regs)
269 regs->r0 = regs->r1 + regs->r0; 271 regs->r0 = regs->r1 + regs->r0;
270 /* fall through */ 272 /* fall through */
271 case ATOMIC_ADD32 + 4: 273 case ATOMIC_ADD32 + 4:
272 put_user(regs->r0, (int *)regs->p0); 274 put_user(regs->r0, up0);
273 regs->pc = ATOMIC_ADD32 + 6; 275 regs->pc = ATOMIC_ADD32 + 6;
274 break; 276 break;
275 277
@@ -277,7 +279,7 @@ void finish_atomic_sections (struct pt_regs *regs)
277 regs->r0 = regs->r1 - regs->r0; 279 regs->r0 = regs->r1 - regs->r0;
278 /* fall through */ 280 /* fall through */
279 case ATOMIC_SUB32 + 4: 281 case ATOMIC_SUB32 + 4:
280 put_user(regs->r0, (int *)regs->p0); 282 put_user(regs->r0, up0);
281 regs->pc = ATOMIC_SUB32 + 6; 283 regs->pc = ATOMIC_SUB32 + 6;
282 break; 284 break;
283 285
@@ -285,7 +287,7 @@ void finish_atomic_sections (struct pt_regs *regs)
285 regs->r0 = regs->r1 | regs->r0; 287 regs->r0 = regs->r1 | regs->r0;
286 /* fall through */ 288 /* fall through */
287 case ATOMIC_IOR32 + 4: 289 case ATOMIC_IOR32 + 4:
288 put_user(regs->r0, (int *)regs->p0); 290 put_user(regs->r0, up0);
289 regs->pc = ATOMIC_IOR32 + 6; 291 regs->pc = ATOMIC_IOR32 + 6;
290 break; 292 break;
291 293
@@ -293,7 +295,7 @@ void finish_atomic_sections (struct pt_regs *regs)
293 regs->r0 = regs->r1 & regs->r0; 295 regs->r0 = regs->r1 & regs->r0;
294 /* fall through */ 296 /* fall through */
295 case ATOMIC_AND32 + 4: 297 case ATOMIC_AND32 + 4:
296 put_user(regs->r0, (int *)regs->p0); 298 put_user(regs->r0, up0);
297 regs->pc = ATOMIC_AND32 + 6; 299 regs->pc = ATOMIC_AND32 + 6;
298 break; 300 break;
299 301
@@ -301,7 +303,7 @@ void finish_atomic_sections (struct pt_regs *regs)
301 regs->r0 = regs->r1 ^ regs->r0; 303 regs->r0 = regs->r1 ^ regs->r0;
302 /* fall through */ 304 /* fall through */
303 case ATOMIC_XOR32 + 4: 305 case ATOMIC_XOR32 + 4:
304 put_user(regs->r0, (int *)regs->p0); 306 put_user(regs->r0, up0);
305 regs->pc = ATOMIC_XOR32 + 6; 307 regs->pc = ATOMIC_XOR32 + 6;
306 break; 308 break;
307 } 309 }
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 85caf9b711a1..b4f062c172c6 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -193,6 +193,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
193{ 193{
194 int ret; 194 int ret;
195 int add = 0; 195 int add = 0;
196 unsigned long __user *datap = (unsigned long __user *)data;
196 197
197 switch (request) { 198 switch (request) {
198 /* when I and D space are separate, these will need to be fixed. */ 199 /* 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)
229 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp); 230 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
230 if (copied != sizeof(tmp)) 231 if (copied != sizeof(tmp))
231 break; 232 break;
232 ret = put_user(tmp, (unsigned long *)data); 233 ret = put_user(tmp, datap);
233 break; 234 break;
234 } 235 }
235 236
@@ -263,7 +264,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
263 } else { 264 } else {
264 tmp = get_reg(child, addr); 265 tmp = get_reg(child, addr);
265 } 266 }
266 ret = put_user(tmp, (unsigned long *)data); 267 ret = put_user(tmp, datap);
267 break; 268 break;
268 } 269 }
269 270
@@ -389,7 +390,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
389 { 390 {
390 391
391 /* Get all gp regs from the child. */ 392 /* Get all gp regs from the child. */
392 ret = ptrace_getregs(child, (void __user *)data); 393 ret = ptrace_getregs(child, datap);
393 break; 394 break;
394 } 395 }
395 396
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index 5564c9588aa8..71cfcd28b39f 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -55,13 +55,13 @@ struct rt_sigframe {
55 struct ucontext uc; 55 struct ucontext uc;
56}; 56};
57 57
58asmlinkage int sys_sigaltstack(const stack_t * uss, stack_t * uoss) 58asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
59{ 59{
60 return do_sigaltstack(uss, uoss, rdusp()); 60 return do_sigaltstack(uss, uoss, rdusp());
61} 61}
62 62
63static inline int 63static inline int
64rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *pr0) 64rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0)
65{ 65{
66 unsigned long usp = 0; 66 unsigned long usp = 0;
67 int err = 0; 67 int err = 0;
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index abcd14817d0e..efb7b25a2633 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -49,7 +49,7 @@
49 * sys_pipe() is the normal C calling standard for creating 49 * sys_pipe() is the normal C calling standard for creating
50 * a pipe. It's not the way unix traditionally does this, though. 50 * a pipe. It's not the way unix traditionally does this, though.
51 */ 51 */
52asmlinkage int sys_pipe(unsigned long *fildes) 52asmlinkage int sys_pipe(unsigned long __user *fildes)
53{ 53{
54 int fd[2]; 54 int fd[2];
55 int error; 55 int error;
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 56a67ab698c7..e8e8f735c236 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -506,7 +506,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
506 506
507 info.si_signo = sig; 507 info.si_signo = sig;
508 info.si_errno = 0; 508 info.si_errno = 0;
509 info.si_addr = (void *)fp->pc; 509 info.si_addr = (void __user *)fp->pc;
510 force_sig_info(sig, &info, current); 510 force_sig_info(sig, &info, current);
511 511
512 trace_buffer_restore(j); 512 trace_buffer_restore(j);