linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* bug in arm_kprobe_decode_insn
@ 2011-02-20 18:24 Marcin Slusarz
  2011-02-21  3:41 ` Nicolas Pitre
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2011-02-20 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

In arch/arm/kernel/kprobes-decode.c there's a function arm_kprobe_decode_insn
which does:

} else if ((insn & 0x0e000000) == 0x0c400000) {
...

This is always false, so code below is dead.

I'm not sure about what was intended here, but I think this change might be correct:

diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index 2c1f005..8f6ed43 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -1437,7 +1437,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
 
 		return space_cccc_1100_010x(insn, asi);
 
-	} else if ((insn & 0x0e000000) == 0x0c400000) {
+	} else if ((insn & 0x0e000000) == 0x0c000000) {
 
 		return space_cccc_110x(insn, asi);
 
--


I found this bug by coccinelle (http://coccinelle.lip6.fr/).
(The script is ugly, so I'm not attaching it here)


Marcin Slusarz

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug in arm_kprobe_decode_insn
  2011-02-20 18:24 bug in arm_kprobe_decode_insn Marcin Slusarz
@ 2011-02-21  3:41 ` Nicolas Pitre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pitre @ 2011-02-21  3:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 20 Feb 2011, Marcin Slusarz wrote:

> Hi
> 
> In arch/arm/kernel/kprobes-decode.c there's a function arm_kprobe_decode_insn
> which does:
> 
> } else if ((insn & 0x0e000000) == 0x0c400000) {
> ...
> 
> This is always false, so code below is dead.

Good catch, thanks.


Nicolas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-21  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-20 18:24 bug in arm_kprobe_decode_insn Marcin Slusarz
2011-02-21  3:41 ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).