summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2014-11-28 12:36:48 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-12-01 11:07:44 +0100
commited7d56e174b11b76e2954f28605c5c16f8814fab (patch)
tree1a57b05fc65da2d41424330c2044bc89d2194de5 /arch/s390
parent57f2ffe14fd125c240babd88b99d8a57d3ed060e (diff)
downloadlinux-ed7d56e174b11b76e2954f28605c5c16f8814fab.tar.bz2
s390/kprobes: fix instruction copy for out of line execution
When we generate the instruction for out of line execution the length of the to be copied instruction was evaluated from a not initialized memory location. Therefore we ended up with a random (2, 4 or 6) number of bytes being copied instead of taking the real instruction length into account. This works surprisingly well most of the time, but still not always. Reported-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@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 ee0396755430..1e4c710dfb92 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -74,7 +74,7 @@ static void copy_instruction(struct kprobe *p)
ftrace_generate_nop_insn((struct ftrace_insn *)p->ainsn.insn);
p->ainsn.is_ftrace_insn = 1;
} else
- memcpy(p->ainsn.insn, p->addr, insn_length(p->opcode >> 8));
+ memcpy(p->ainsn.insn, p->addr, insn_length(*p->addr >> 8));
p->opcode = p->ainsn.insn[0];
if (!probe_is_insn_relative_long(p->ainsn.insn))
return;