aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorDavid Wilder <dwilder@us.ibm.com>2007-08-22 07:51:44 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-08-22 07:51:49 -0400
commit9c5f225f1a2c67c57ff5dfbe0589de20c5706a16 (patch)
tree58516a2e938e65f2ab946cb1a19c65f9ff22c764 /arch/s390
parent9b5a03e198c951225d0deb05f3107a4631791266 (diff)
[S390] kprobes: fix instruction length calculation
Placing a kprobe on "bc" instruction (s390/s390x) can cause an oops. The instruction length is encoded into the first two bits of the s390 instruction. Kprobe is incorrectly computing the instruction length. The instruction length is used for determining what type of "fix-up" is needed for conditional branch instruction. The problem can bee seen by placing a kprobe on a "bc" instruction that will not branch. The results is that Kprobe incorrectly computes the new instruction pointer (psw.addr) after single stepping the instruction. The problem is corrected with this patch. Signed-off-by: David Wilder <dwilder@us.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/kprobes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 358d2bbbc481..e40373d9fbce 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -85,7 +85,7 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
85 ainsn->reg = (*ainsn->insn & 0xf0) >> 4; 85 ainsn->reg = (*ainsn->insn & 0xf0) >> 4;
86 86
87 /* save the instruction length (pop 5-5) in bytes */ 87 /* save the instruction length (pop 5-5) in bytes */
88 switch (*(__u8 *) (ainsn->insn) >> 4) { 88 switch (*(__u8 *) (ainsn->insn) >> 6) {
89 case 0: 89 case 0:
90 ainsn->ilen = 2; 90 ainsn->ilen = 2;
91 break; 91 break;