linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marcin.slusarz@gmail.com (Marcin Slusarz)
To: linux-arm-kernel@lists.infradead.org
Subject: bug in arm_kprobe_decode_insn
Date: Sun, 20 Feb 2011 19:24:37 +0100	[thread overview]
Message-ID: <20110220182437.GA24789@joi.lan> (raw)

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

             reply	other threads:[~2011-02-20 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 18:24 Marcin Slusarz [this message]
2011-02-21  3:41 ` bug in arm_kprobe_decode_insn Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110220182437.GA24789@joi.lan \
    --to=marcin.slusarz@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).