]> git.baikalelectronics.ru Git - kernel.git/commit
s390/bpf: fix lcgr instruction encoding
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 12 Aug 2019 15:03:32 +0000 (17:03 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 12 Aug 2019 16:03:35 +0000 (18:03 +0200)
commite6a7ec2961b05d9c1233b0044aba0b4d66d39e67
treeaaa921c0da8814d38672b391a2dbd63d3747329c
parentfa203343563b9a8dd2daaefddcaa8ed08e6ddd2a
s390/bpf: fix lcgr instruction encoding

"masking, test in bounds 3" fails on s390, because
BPF_ALU64_IMM(BPF_NEG, BPF_REG_2, 0) ignores the top 32 bits of
BPF_REG_2. The reason is that JIT emits lcgfr instead of lcgr.
The associated comment indicates that the code was intended to
emit lcgr in the first place, it's just that the wrong opcode
was used.

Fix by using the correct opcode.

Fixes: 03773c1ba70e ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/s390/net/bpf_jit_comp.c