diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2026-05-29 19:28:29 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-06-01 03:48:27 +0300 |
| commit | 41300d032a1b1d91a3ed996ad21905463e344beb (patch) | |
| tree | 7fbc9c327de4cb18a7edc1e13c4962dda5bc57de /include/linux/timerqueue.h | |
| parent | d2f7bd066ed492aeaf82864fbf1f06770f9d9f9d (diff) | |
| download | linux-41300d032a1b1d91a3ed996ad21905463e344beb.tar.xz | |
libbpf: Skip endianness swap when loader generation failed
bpf_gen__prog_load() byte-swaps the program insns and the {func,line}_info
and CO-RE relo blobs in place for cross-endian targets. The blob offsets
come from add_data(), which returns 0 on failure: realloc_data_buf() either
frees and NULLs gen->data_start (realloc OOM) or returns early on an
already-latched gen->error, leaving a stale, possibly too-small buffer.
Neither bswap site checked for this. With gen->swapped_endian set and a
failed generation, "gen->data_start + off" becomes NULL + 0. Guard the
same way via !gen->error so they are skipped once generation has failed.
Fixes: 8ca3323dce43 ("libbpf: Support creating light skeleton of either endianness")
Reported-by: sashiko <sashiko@sashiko.dev>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20260529162829.315921-1-daniel@iogearbox.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
