]> git.baikalelectronics.ru Git - kernel.git/commit
s390/bpf: Fix backward jumps
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Thu, 21 May 2015 13:39:31 +0000 (15:39 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Jun 2015 07:39:18 +0000 (09:39 +0200)
commit128acc31a717901db16fc27e361f80723b8d483b
tree8461f72909499a558b1ef89cde41d25ae0854fee
parent568eab93fec61eff6fde03b6951b076cd25a84e9
s390/bpf: Fix backward jumps

Currently all backward jumps crash for JITed s390x eBPF programs
with an illegal instruction program check and kernel panic. Because
for negative values the opcode of the jump instruction is overriden
by the negative branch offset an illegal instruction is generated
by the JIT:

 000003ff802da378c01100000002   lgfi    %r1,2
 000003ff802da37efffffff52065   unknown <-- illegal instruction
 000003ff802da384b904002e       lgr     %r2,%r14

So fix this and mask the offset in order not to damage the opcode.

Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/net/bpf_jit_comp.c