]> git.hungrycats.org Git - linux/commitdiff
s390/disassembler: add missing end marker for e7 table
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 26 Sep 2017 07:16:48 +0000 (09:16 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Fri, 8 Dec 2017 23:00:59 +0000 (18:00 -0500)
[ Upstream commit 5c50538752af7968f53924b22dede8ed4ce4cb3b ]

The e7 opcode table does not have an end marker. Hence when trying to
find an unknown e7 instruction the code will access memory behind the
table until it finds something that matches the opcode, or the kernel
crashes, whatever comes first.

This affects not only the in-kernel disassembler but also uprobes and
kprobes which refuse to set a probe on unknown instructions, and
therefore search the opcode tables to figure out if instructions are
known or not.

Cc: <stable@vger.kernel.org> # v3.18+
Fixes: 3585cb0280654 ("s390/disassembler: add vector instructions")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
arch/s390/kernel/dis.c

index 8140d10c67850902d9f60c967000dff7bdcd26a7..742c4e201d52551341ddfe8835e2b635706a61b0 100644 (file)
@@ -1549,6 +1549,7 @@ static struct s390_insn opcode_e7[] = {
        { "vfsq", 0xce, INSTR_VRR_VV000MM },
        { "vfs", 0xe2, INSTR_VRR_VVV00MM },
        { "vftci", 0x4a, INSTR_VRI_VVIMM },
+       { "", 0, INSTR_INVALID }
 };
 
 static struct s390_insn opcode_eb[] = {