s390/bpf: Fix branch shortening during codegen pass
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 7 Sep 2021 09:58:59 +0000 (11:58 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 16 Sep 2021 08:39:55 +0000 (10:39 +0200)
commit1511df6f5e9ef32826f20db2ee81f8527154dc14
tree14f1385f7edd9c645bcf29fc8e8903e8187b4564
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
s390/bpf: Fix branch shortening during codegen pass

EMIT6_PCREL() macro assumes that the previous pass generated 6 bytes
of code, which is not the case if branch shortening took place. Fix by
using jit->prg, like all the other EMIT6_PCREL_*() macros.

Reported-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/net/bpf_jit_comp.c