summaryrefslogtreecommitdiff
path: root/Documentation/gpu/intel-display/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2026-05-29 11:41:17 +0200
committerAlexei Starovoitov <ast@kernel.org>2026-05-31 17:47:48 -0700
commit3c5e2f1a85844abbb65df4694f5ebad0a13e219c (patch)
tree742817537cb4289866c89d4efdea2ac68416feab /Documentation/gpu/intel-display/git@git.tavy.me:linux.git
parente2c88266147ff92ca25e6577158a9a0b3b261a30 (diff)
libbpf: Skip hash computation when loader generation failed
bpf_gen__finish() calls compute_sha_update_offsets() gated only on the gen_hash option, without first consulting gen->error. On a failed generation this is buggy: a failed realloc_data_buf() sets gen->data_start to NULL (leaving gen->data_cur dangling), so compute_sha_update_offsets() runs libbpf_sha256() over a NULL buffer with a bogus length; a failed realloc_insn_buf() likewise sets gen->insn_start to NULL and the hash immediates get patched through that NULL base. The computed program is discarded in either case, since the following "if (!gen->error)" block does not publish opts->insns once an error is set. Thus, skip the hash pass when generation has already failed. Fixes: ea923080c145 ("libbpf: Embed and verify the metadata hash in the loader") Reported-by: sashiko <sashiko@sashiko.dev> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20260529094119.307264-2-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'Documentation/gpu/intel-display/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions