aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/traps.c')
-rw-r--r--arch/s390/kernel/traps.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 66375a5e3d12..92ecffbc8d82 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -462,7 +462,8 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
462 local_irq_enable(); 462 local_irq_enable();
463 463
464 if (regs->psw.mask & PSW_MASK_PSTATE) { 464 if (regs->psw.mask & PSW_MASK_PSTATE) {
465 get_user(*((__u16 *) opcode), (__u16 __user *) location); 465 if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
466 return;
466 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { 467 if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
467 if (current->ptrace & PT_PTRACED) 468 if (current->ptrace & PT_PTRACED)
468 force_sig(SIGTRAP, current); 469 force_sig(SIGTRAP, current);
@@ -470,20 +471,25 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
470 signal = SIGILL; 471 signal = SIGILL;
471#ifdef CONFIG_MATHEMU 472#ifdef CONFIG_MATHEMU
472 } else if (opcode[0] == 0xb3) { 473 } else if (opcode[0] == 0xb3) {
473 get_user(*((__u16 *) (opcode+2)), location+1); 474 if (get_user(*((__u16 *) (opcode+2)), location+1))
475 return;
474 signal = math_emu_b3(opcode, regs); 476 signal = math_emu_b3(opcode, regs);
475 } else if (opcode[0] == 0xed) { 477 } else if (opcode[0] == 0xed) {
476 get_user(*((__u32 *) (opcode+2)), 478 if (get_user(*((__u32 *) (opcode+2)),
477 (__u32 __user *)(location+1)); 479 (__u32 __user *)(location+1)))
480 return;
478 signal = math_emu_ed(opcode, regs); 481 signal = math_emu_ed(opcode, regs);
479 } else if (*((__u16 *) opcode) == 0xb299) { 482 } else if (*((__u16 *) opcode) == 0xb299) {
480 get_user(*((__u16 *) (opcode+2)), location+1); 483 if (get_user(*((__u16 *) (opcode+2)), location+1))
484 return;
481 signal = math_emu_srnm(opcode, regs); 485 signal = math_emu_srnm(opcode, regs);
482 } else if (*((__u16 *) opcode) == 0xb29c) { 486 } else if (*((__u16 *) opcode) == 0xb29c) {
483 get_user(*((__u16 *) (opcode+2)), location+1); 487 if (get_user(*((__u16 *) (opcode+2)), location+1))
488 return;
484 signal = math_emu_stfpc(opcode, regs); 489 signal = math_emu_stfpc(opcode, regs);
485 } else if (*((__u16 *) opcode) == 0xb29d) { 490 } else if (*((__u16 *) opcode) == 0xb29d) {
486 get_user(*((__u16 *) (opcode+2)), location+1); 491 if (get_user(*((__u16 *) (opcode+2)), location+1))
492 return;
487 signal = math_emu_lfpc(opcode, regs); 493 signal = math_emu_lfpc(opcode, regs);
488#endif 494#endif
489 } else 495 } else