Skip to content
Commit 676b2daa authored by Song Liu's avatar Song Liu Committed by Alexei Starovoitov
Browse files

bpf, x86: Set header->size properly before freeing it



On do_jit failure path, the header is freed by bpf_jit_binary_pack_free.
While bpf_jit_binary_pack_free doesn't require proper ro_header->size,
bpf_prog_pack_free still uses it. Set header->size in bpf_int_jit_compile
before calling bpf_jit_binary_pack_free.

Fixes: 1022a549 ("bpf, x86_64: Use bpf_jit_binary_pack_alloc")
Fixes: 33c98058 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]")
Reported-by: default avatarKui-Feng Lee <kuifeng@fb.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220302175126.247459-3-song@kernel.org
parent eed1fcee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment