From 9737b9cb341c86bfb59c8a0c28eff9ce809d314f Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Thu, 9 Jun 2011 09:12:58 +0100 Subject: [PATCH] --- yaml --- r: 258383 b: refs/heads/master c: 56d8fbddc2a2be7aa81d65e5a6f0f6093ee70c48 h: refs/heads/master i: 258381: d1ee04bc2862d00e3df9bbfd8b9786e7a66d7cb2 258379: 3a7a13a310849458067e98e71d0364f5a35e77d4 258375: fa7274a99ed875c8ac9663af2239a1363bf7e5df 258367: cf0a58d7a8083b2494aa5faf626183783fd501e6 v: v3 --- [refs] | 2 +- trunk/arch/arm/kernel/kprobes-arm.c | 37 +++++++++++++++-------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 53fbdd8c72c1..3a2a77f915bf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ad2e81a78d016176b9f194414495a4ce166399e1 +refs/heads/master: 56d8fbddc2a2be7aa81d65e5a6f0f6093ee70c48 diff --git a/trunk/arch/arm/kernel/kprobes-arm.c b/trunk/arch/arm/kernel/kprobes-arm.c index 58faacc598bf..319e6feb0363 100644 --- a/trunk/arch/arm/kernel/kprobes-arm.c +++ b/trunk/arch/arm/kernel/kprobes-arm.c @@ -1415,23 +1415,24 @@ static const union decode_item arm_cccc_0111_____xxx1_table[] = { DECODE_END }; -static enum kprobe_insn __kprobes -space_cccc_01xx(kprobe_opcode_t insn, struct arch_specific_insn *asi) -{ - /* LDR : cccc 01xx x0x1 xxxx xxxx xxxx xxxx xxxx */ - /* LDRB : cccc 01xx x1x1 xxxx xxxx xxxx xxxx xxxx */ - /* LDRBT : cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */ - /* LDRT : cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */ - /* STR : cccc 01xx x0x0 xxxx xxxx xxxx xxxx xxxx */ - /* STRB : cccc 01xx x1x0 xxxx xxxx xxxx xxxx xxxx */ - /* STRBT : cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */ - /* STRT : cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */ - - if ((insn & 0x00500000) == 0x00500000 && is_r15(insn, 12)) - return INSN_REJECTED; /* LDRB into PC */ - - return prep_emulate_ldr_str(insn, asi); -} +static const union decode_item arm_cccc_01xx_table[] = { + /* Load/store word and unsigned byte */ + + /* LDRB/STRB pc,[...] cccc 01xx x0xx xxxx xxxx xxxx xxxx xxxx */ + DECODE_REJECT (0x0c40f000, 0x0440f000), + + /* LDR cccc 01xx x0x1 xxxx xxxx xxxx xxxx xxxx */ + /* LDRB cccc 01xx x1x1 xxxx xxxx xxxx xxxx xxxx */ + /* LDRBT cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */ + /* LDRT cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */ + /* STR cccc 01xx x0x0 xxxx xxxx xxxx xxxx xxxx */ + /* STRB cccc 01xx x1x0 xxxx xxxx xxxx xxxx xxxx */ + /* STRBT cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */ + /* STRT cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */ + DECODE_CUSTOM (0x0c000000, 0x04000000, prep_emulate_ldr_str), + + DECODE_END +}; static enum kprobe_insn __kprobes space_cccc_100x(kprobe_opcode_t insn, struct arch_specific_insn *asi) @@ -1526,7 +1527,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi) else if ((insn & 0x0c000000) == 0x04000000) - return space_cccc_01xx(insn, asi); + return kprobe_decode_insn(insn, asi, arm_cccc_01xx_table, false); else if ((insn & 0x0e000000) == 0x08000000)