diff options
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r-- | arch/mips/kernel/traps.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index d06db5f8115f..f9a6a5665559 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -339,9 +339,9 @@ asmlinkage void do_be(struct pt_regs *regs) | |||
339 | 339 | ||
340 | static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode) | 340 | static inline int get_insn_opcode(struct pt_regs *regs, unsigned int *opcode) |
341 | { | 341 | { |
342 | unsigned int *epc; | 342 | unsigned int __user *epc; |
343 | 343 | ||
344 | epc = (unsigned int *) regs->cp0_epc + | 344 | epc = (unsigned int __user *) regs->cp0_epc + |
345 | ((regs->cp0_cause & CAUSEF_BD) != 0); | 345 | ((regs->cp0_cause & CAUSEF_BD) != 0); |
346 | if (!get_user(*opcode, epc)) | 346 | if (!get_user(*opcode, epc)) |
347 | return 0; | 347 | return 0; |
@@ -371,7 +371,7 @@ static struct task_struct *ll_task = NULL; | |||
371 | 371 | ||
372 | static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) | 372 | static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) |
373 | { | 373 | { |
374 | unsigned long value, *vaddr; | 374 | unsigned long value, __user *vaddr; |
375 | long offset; | 375 | long offset; |
376 | int signal = 0; | 376 | int signal = 0; |
377 | 377 | ||
@@ -385,7 +385,8 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode) | |||
385 | offset <<= 16; | 385 | offset <<= 16; |
386 | offset >>= 16; | 386 | offset >>= 16; |
387 | 387 | ||
388 | vaddr = (unsigned long *)((long)(regs->regs[(opcode & BASE) >> 21]) + offset); | 388 | vaddr = (unsigned long __user *) |
389 | ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset); | ||
389 | 390 | ||
390 | if ((unsigned long)vaddr & 3) { | 391 | if ((unsigned long)vaddr & 3) { |
391 | signal = SIGBUS; | 392 | signal = SIGBUS; |
@@ -418,7 +419,8 @@ sig: | |||
418 | 419 | ||
419 | static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode) | 420 | static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode) |
420 | { | 421 | { |
421 | unsigned long *vaddr, reg; | 422 | unsigned long __user *vaddr; |
423 | unsigned long reg; | ||
422 | long offset; | 424 | long offset; |
423 | int signal = 0; | 425 | int signal = 0; |
424 | 426 | ||
@@ -432,7 +434,8 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode) | |||
432 | offset <<= 16; | 434 | offset <<= 16; |
433 | offset >>= 16; | 435 | offset >>= 16; |
434 | 436 | ||
435 | vaddr = (unsigned long *)((long)(regs->regs[(opcode & BASE) >> 21]) + offset); | 437 | vaddr = (unsigned long __user *) |
438 | ((unsigned long)(regs->regs[(opcode & BASE) >> 21]) + offset); | ||
436 | reg = (opcode & RT) >> 16; | 439 | reg = (opcode & RT) >> 16; |
437 | 440 | ||
438 | if ((unsigned long)vaddr & 3) { | 441 | if ((unsigned long)vaddr & 3) { |
@@ -498,7 +501,7 @@ asmlinkage void do_ov(struct pt_regs *regs) | |||
498 | info.si_code = FPE_INTOVF; | 501 | info.si_code = FPE_INTOVF; |
499 | info.si_signo = SIGFPE; | 502 | info.si_signo = SIGFPE; |
500 | info.si_errno = 0; | 503 | info.si_errno = 0; |
501 | info.si_addr = (void *)regs->cp0_epc; | 504 | info.si_addr = (void __user *) regs->cp0_epc; |
502 | force_sig_info(SIGFPE, &info, current); | 505 | force_sig_info(SIGFPE, &info, current); |
503 | } | 506 | } |
504 | 507 | ||
@@ -584,7 +587,7 @@ asmlinkage void do_bp(struct pt_regs *regs) | |||
584 | info.si_code = FPE_INTOVF; | 587 | info.si_code = FPE_INTOVF; |
585 | info.si_signo = SIGFPE; | 588 | info.si_signo = SIGFPE; |
586 | info.si_errno = 0; | 589 | info.si_errno = 0; |
587 | info.si_addr = (void *)regs->cp0_epc; | 590 | info.si_addr = (void __user *) regs->cp0_epc; |
588 | force_sig_info(SIGFPE, &info, current); | 591 | force_sig_info(SIGFPE, &info, current); |
589 | break; | 592 | break; |
590 | default: | 593 | default: |
@@ -621,7 +624,7 @@ asmlinkage void do_tr(struct pt_regs *regs) | |||
621 | info.si_code = FPE_INTOVF; | 624 | info.si_code = FPE_INTOVF; |
622 | info.si_signo = SIGFPE; | 625 | info.si_signo = SIGFPE; |
623 | info.si_errno = 0; | 626 | info.si_errno = 0; |
624 | info.si_addr = (void *)regs->cp0_epc; | 627 | info.si_addr = (void __user *) regs->cp0_epc; |
625 | force_sig_info(SIGFPE, &info, current); | 628 | force_sig_info(SIGFPE, &info, current); |
626 | break; | 629 | break; |
627 | default: | 630 | default: |