diff options
author | Björn Töpel <bjorn@kernel.org> | 2021-10-28 14:51:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-02 19:48:21 +0100 |
commit | cac6b043cea3e120f4fccec16f7381747cbfdc0d (patch) | |
tree | 488e6ac6ad69bfb0f67df915bb08b1bba63bd1ed /kernel/bpf/arraymap.c | |
parent | 01599bf7cc2b49c3d2be886cb438647dc25446ed (diff) |
riscv, bpf: Fix potential NULL dereference
commit 27de809a3d83a6199664479ebb19712533d6fd9b upstream.
The bpf_jit_binary_free() function requires a non-NULL argument. When
the RISC-V BPF JIT fails to converge in NR_JIT_ITERATIONS steps,
jit_data->header will be NULL, which triggers a NULL
dereference. Avoid this by checking the argument, prior calling the
function.
Fixes: ca6cb5447cec ("riscv, bpf: Factor common RISC-V JIT code")
Signed-off-by: Björn Töpel <bjorn@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20211028125115.514587-1-bjorn@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/bpf/arraymap.c')
0 files changed, 0 insertions, 0 deletions