]> git.baikalelectronics.ru Git - kernel.git/commit
s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 7 Sep 2021 11:41:16 +0000 (13:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:46 +0000 (12:26 +0200)
commit5503a6c8a397141d544f00d429aba99fd336f7aa
tree221e4beed440d46ef3c8e9511b39f4f7411ea4f7
parent95ef52e32c4aa87bff1961e449692c43f193ec72
s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant

commit 6e61dc9da0b7a0d91d57c2e20b5ea4fd2d4e7e53 upstream.

The JIT uses agfi for subtracting constants, but -(-0x80000000) cannot
be represented as a 32-bit signed binary integer. Fix by using algfi in
this particular case.

Reported-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Fixes: 9f7ede77bdb9 ("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