When jit_subprogs() fails after some subprogs were already JITed, it frees them through bpf_jit_free(). That frees jit_data, but not the offset table that jit_data keeps for the extra pass, so every such failure leaks the table. Free the offset table there as well, as the x86, riscv and LoongArch JITs do. Fixes: db496944fdaa ("bpf: arm64: add JIT support for multi-function programs") Signed-off-by: Daniel Borkmann --- arch/arm64/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 6deedb169915..e72bf79d219c 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -3616,6 +3616,7 @@ void bpf_jit_free(struct bpf_prog *prog) */ if (jit_data) { bpf_jit_binary_pack_finalize(jit_data->ro_header, jit_data->header); + kvfree(jit_data->ctx.offset); kfree(jit_data); } prog->bpf_func = (void *)prog->bpf_func - cfi_get_offset(); -- 2.43.0