Skip to content
Commit e1b80a5e authored by Björn Töpel's avatar Björn Töpel Committed by Greg Kroah-Hartman
Browse files

riscv, bpf: Fix potential NULL dereference

commit 27de809a 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: ca6cb544

 ("riscv, bpf: Factor common RISC-V JIT code")
Signed-off-by: default avatarBjörn Töpel <bjorn@kernel.org>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20211028125115.514587-1-bjorn@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b529f88d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment