]> git.ipfire.org Git - people/arne_f/kernel.git/commit
s390/bpf: Fix optimizing out zero-extensions
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 6 Sep 2021 13:04:14 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:39:33 +0000 (12:39 +0200)
commit7a31ec4d215a800b504de74b248795f8be666f8e
treea66d3ceff1d0e71938638d451c6cc005eb529cb1
parent10203c14d608d8ca3ebdc04f52bf3e90efcb72a6
s390/bpf: Fix optimizing out zero-extensions

commit db7bee653859ef7179be933e7d1384644f795f26 upstream.

Currently the JIT completely removes things like `reg32 += 0`,
however, the BPF_ALU semantics requires the target register to be
zero-extended in such cases.

Fix by optimizing out only the arithmetic operation, but not the
subsequent zero-extension.

Reported-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/net/bpf_jit_comp.c