aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/kprobes.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-09-13 14:14:10 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 17:16:50 +0200
commit1ffa11abfe90320abe82bf5bb7eeca154e333058 (patch)
tree4bd80efa5b44e470471a78698ac736fab6867644 /arch/s390/kernel/kprobes.c
parents390/kprobes: use insn_length helper function (diff)
downloadlinux-dev-1ffa11abfe90320abe82bf5bb7eeca154e333058.tar.xz
linux-dev-1ffa11abfe90320abe82bf5bb7eeca154e333058.zip
s390/kprobes: allow kprobes only on known instructions
Since we have an in-kernel disassembler we can make sure that there won't be any kprobes set on random data. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/kprobes.c')
-rw-r--r--arch/s390/kernel/kprobes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index c52fdf290301..59a9c35c4598 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -60,6 +60,8 @@ struct kprobe_insn_cache kprobe_dmainsn_slots = {
static int __kprobes is_prohibited_opcode(kprobe_opcode_t *insn)
{
+ if (!is_known_insn((unsigned char *)insn))
+ return -EINVAL;
switch (insn[0] >> 8) {
case 0x0c: /* bassm */
case 0x0b: /* bsm */