• Michael Holzheu's avatar
    s390/bpf: Fix backward jumps · b035b60d
    Michael Holzheu authored
    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:
     000003ff802da378: c01100000002   lgfi    %r1,2
     000003ff802da37e: fffffff52065   unknown <-- illegal instruction
     000003ff802da384: b904002e       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: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>