Skip to content

Commit

Permalink
[S390] kprobes: fix instruction length calculation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Wilder authored and Martin Schwidefsky committed Aug 22, 2007
1 parent 9b5a03e commit 9c5f225
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
ainsn->reg = (*ainsn->insn & 0xf0) >> 4;

/* save the instruction length (pop 5-5) in bytes */
switch (*(__u8 *) (ainsn->insn) >> 4) {
switch (*(__u8 *) (ainsn->insn) >> 6) {
case 0:
ainsn->ilen = 2;
break;
Expand Down

0 comments on commit 9c5f225

Please sign in to comment.