s390/bpf: Fix optimizing out zero-extensions
stable inclusion from linux-4.19.208 commit ddf58efd05b5d16d86ea4638675e8bd397320930 CVE: CVE-2021-20320 -------------------------------- commit db7bee65 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: 05462310 ("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> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Signed-off-by:
He Fengqing <hefengqing@huawei.com> Reviewed-by:
weiyang wang <wangweiyang2@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment