Re: [PATCH bpf] bpf, riscv: Fix tail call count off by one in RV32 BPF JIT

From: Alexei Starovoitov
Date: Thu Apr 23 2020 - 01:29:19 EST


On Mon, Apr 20, 2020 at 5:28 PM Luke Nelson <lukenels@xxxxxxxxxxxxxxxxx> wrote:
>
> This patch fixes an off by one error in the RV32 JIT handling for BPF
> tail call. Currently, the code decrements TCC before checking if it
> is less than zero. This limits the maximum number of tail calls to 32
> instead of 33 as in other JITs. The fix is to instead check the old
> value of TCC before decrementing.
>
> Fixes: 5f316b65e99f ("riscv, bpf: Add RV32G eBPF JIT")
> Signed-off-by: Luke Nelson <luke.r.nels@xxxxxxxxx>

Applied. Thanks