linux/tools/lib/bpf
Eric Biggers 4d920ed684 libbpf: Fix undefined behavior in {get,put}_unaligned_be32()
These violate aliasing rules and may be miscompiled unless
-fno-strict-aliasing is used.  Replace them with the standard memcpy()
solution.  Note that compilers know how to optimize this properly.

Fixes: 4a1c9e544b ("libbpf: remove linux/unaligned.h dependency for libbpf_sha256()")
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20251006012037.159295-1-ebiggers@kernel.org
2025-10-06 09:16:29 -07:00
..
.gitignore tools build: Correct bpf fixdep dependencies 2024-08-05 12:19:48 -03:00
Build libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
Makefile tools: Remove redundant quiet setup 2025-02-18 16:27:43 -03:00
bpf.c bpf: Implement signature verification for BPF programs 2025-09-22 18:58:03 -07:00
bpf.h libbpf: Support exclusive map creation 2025-09-18 19:11:42 -07:00
bpf_core_read.h bpf: Fix uninitialized values in BPF_{CORE,PROBE}_READ 2025-05-05 14:20:28 -07:00
bpf_endian.h
bpf_gen_internal.h libbpf: Embed and verify the metadata hash in the loader 2025-09-22 19:17:55 -07:00
bpf_helpers.h libbpf: __arg_untrusted in bpf_helpers.h 2025-07-07 08:25:07 -07:00
bpf_prog_linfo.c libbpf: Streamline error reporting for high-level APIs 2021-05-25 17:32:35 -07:00
bpf_tracing.h libbpf: Fix some typos in comments 2024-09-09 16:05:40 -07:00
btf.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
btf.h libbpf: Add support for printing BTF character arrays as strings 2025-06-05 13:45:16 -07:00
btf_dump.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
btf_iter.c libbpf,bpf: Share BTF relocate-related code with kernel 2024-06-21 14:45:07 -07:00
btf_relocate.c libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED 2025-01-16 15:34:18 -08:00
elf.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
features.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
gen_loader.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
hashmap.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
hashmap.h libbpf: Fix possible compiler warnings in hashmap 2024-10-11 12:36:59 -07:00
libbpf.c libbpf: move libbpf_sha256() implementation into libbpf_utils.c 2025-10-01 15:27:25 -07:00
libbpf.h libbpf: Embed and verify the metadata hash in the loader 2025-09-22 19:17:55 -07:00
libbpf.map libbpf: Support exclusive map creation 2025-09-18 19:11:42 -07:00
libbpf.pc.template
libbpf_common.h libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET 2023-11-09 19:07:51 -08:00
libbpf_internal.h libbpf: move libbpf_sha256() implementation into libbpf_utils.c 2025-10-01 15:27:25 -07:00
libbpf_legacy.h libbpf: Fix some typos in comments 2024-09-09 16:05:40 -07:00
libbpf_probes.c bpf: improve error message for unsupported helper 2024-03-28 18:30:53 -07:00
libbpf_utils.c libbpf: Fix undefined behavior in {get,put}_unaligned_be32() 2025-10-06 09:16:29 -07:00
libbpf_version.h libbpf: start v1.7 dev cycle 2025-07-16 18:37:27 -07:00
linker.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
netlink.c libbpf: Support creating and destroying qdisc 2025-04-17 10:54:41 -07:00
nlattr.c libbpf: Use proper errno value in nlattr 2025-05-12 15:22:54 -07:00
nlattr.h libbpf: add API to get XDP/XSK supported features 2023-02-02 20:48:24 -08:00
relo_core.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
relo_core.h bpf, libbpf: Add type match support 2022-07-05 21:14:25 -07:00
ringbuf.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
skel_internal.h libbpf: Update light skeleton for signing 2025-09-22 19:17:25 -07:00
strset.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
strset.h libbpf: Extract internal set-of-strings datastructure APIs 2021-03-18 16:14:22 -07:00
usdt.bpf.h libbpf: Fix USDT SIB argument handling causing unrecognized register error 2025-08-27 15:44:25 -07:00
usdt.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
zip.c libbpf: Remove unneeded semicolon 2024-10-03 17:47:35 -07:00
zip.h libbpf: Implement basic zip archive parsing support 2023-03-01 16:05:34 -08:00