]> git.baikalelectronics.ru Git - kernel.git/commit
s390/bpf: Use brcl for jumping to exit_ip if necessary
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 17 Jul 2020 16:53:24 +0000 (18:53 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Jul 2020 20:26:25 +0000 (13:26 -0700)
commit68d6f887e0ad7bf7d5e4a5d416965d8a5790a5f7
treefffc3137156ad321370641684a593de6532dcf9c
parent7e7793d4db13d6e377bbc0565fa2c7e9bcb6a45a
s390/bpf: Use brcl for jumping to exit_ip if necessary

"BPF_MAXINSNS: Maximum possible literals" test causes panic with
bpf_jit_harden = 2. The reason is that BPF_JMP | BPF_EXIT is always
emitted as brc, however, after removal of JITed image size
limitations, brcl might be required.

Fix by using brcl when necessary.

Fixes: 1dea287d63e8 ("s390/bpf: Use relative long branches")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200717165326.6786-4-iii@linux.ibm.com
arch/s390/net/bpf_jit_comp.c