Commit 4d920ed6 authored by Eric Biggers's avatar Eric Biggers Committed by Andrii Nakryiko
Browse files

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: 4a1c9e54 ("libbpf: remove linux/unaligned.h dependency for libbpf_sha256()")
Signed-off-by: default avatarEric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarYonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20251006012037.159295-1-ebiggers@kernel.org
parent de734222
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment