Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258335
b: refs/heads/master
c: 3b26945
h: refs/heads/master
i:
  258333: e7679af
  258331: 6cd3d8e
  258327: 7facc1b
  258319: f58cadb
  258303: 1cd06c0
v: v3
  • Loading branch information
Jon Medhurst authored and Tixy committed Jul 13, 2011
1 parent 0150bbc commit ad50c0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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: 3cca6c243568d355c1ccecaaa71bf490f014d729
refs/heads/master: 3b26945597d5eff5d428a268c9d109338fce801e
10 changes: 8 additions & 2 deletions trunk/arch/arm/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ void __kprobes arch_arm_kprobe(struct kprobe *p)

void __kprobes arch_arm_kprobe(struct kprobe *p)
{
*p->addr = KPROBE_ARM_BREAKPOINT_INSTRUCTION;
kprobe_opcode_t insn = p->opcode;
kprobe_opcode_t brkp = KPROBE_ARM_BREAKPOINT_INSTRUCTION;
if (insn >= 0xe0000000)
brkp |= 0xe0000000; /* Unconditional instruction */
else
brkp |= insn & 0xf0000000; /* Copy condition from insn */
*p->addr = brkp;
flush_insns(p->addr, sizeof(p->addr[0]));
}

Expand Down Expand Up @@ -625,7 +631,7 @@ static struct undef_hook kprobes_thumb32_break_hook = {
#else /* !CONFIG_THUMB2_KERNEL */

static struct undef_hook kprobes_arm_break_hook = {
.instr_mask = 0xffffffff,
.instr_mask = 0x0fffffff,
.instr_val = KPROBE_ARM_BREAKPOINT_INSTRUCTION,
.cpsr_mask = MODE_MASK,
.cpsr_val = SVC_MODE,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* These undefined instructions must be unique and
* reserved solely for kprobes' use.
*/
#define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0xe7f001f8
#define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0x07f001f8
#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018

Expand Down

0 comments on commit ad50c0a

Please sign in to comment.