Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258161
b: refs/heads/master
c: 73b7d40
h: refs/heads/master
i:
  258159: 4a87c5b
v: v3
  • Loading branch information
Martin Schwidefsky committed Jul 24, 2011
1 parent 201750b commit 5f16b7e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fa52aa7a82f9226b3874a69816bda3af821f002
refs/heads/master: 73b7d40ff1bcd44b4245c2714b88cf872fe44685
23 changes: 17 additions & 6 deletions trunk/arch/s390/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/tracehook.h>
#include <linux/ptrace.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/smp.h>
Expand Down Expand Up @@ -325,10 +325,17 @@ static inline void __user *get_psw_address(struct pt_regs *regs,

void __kprobes do_per_trap(struct pt_regs *regs)
{
siginfo_t info;

if (notify_die(DIE_SSTEP, "sstep", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
return;
if (current->ptrace)
force_sig(SIGTRAP, current);
if (!current->ptrace)
return;
info.si_signo = SIGTRAP;
info.si_errno = 0;
info.si_code = TRAP_HWBKPT;
info.si_addr = (void *) current->thread.per_event.address;
force_sig_info(SIGTRAP, &info, current);
}

static void default_trap_handler(struct pt_regs *regs, long pgm_int_code,
Expand Down Expand Up @@ -421,9 +428,13 @@ static void __kprobes illegal_op(struct pt_regs *regs, long pgm_int_code,
if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
return;
if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
if (current->ptrace)
force_sig(SIGTRAP, current);
else
if (current->ptrace) {
info.si_signo = SIGTRAP;
info.si_errno = 0;
info.si_code = TRAP_BRKPT;
info.si_addr = location;
force_sig_info(SIGTRAP, &info, current);
} else
signal = SIGILL;
#ifdef CONFIG_MATHEMU
} else if (opcode[0] == 0xb3) {
Expand Down

0 comments on commit 5f16b7e

Please sign in to comment.