]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Update the bpf_prog_calc_tag to use SHA256
authorKP Singh <kpsingh@kernel.org>
Sun, 14 Sep 2025 21:51:30 +0000 (23:51 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Sep 2025 02:10:20 +0000 (19:10 -0700)
commit603b4416232524dafde8e2cf859788dae786dea1
tree5ba8d6c36180b395c322e68aac4d116c6e36fe91
parent3547a61ee2fe8f1fc46d4326a9517d97ae3614cd
bpf: Update the bpf_prog_calc_tag to use SHA256

Exclusive maps restrict map access to specific programs using a hash.
The current hash used for this is SHA1, which is prone to collisions.
This patch uses SHA256, which  is more resilient against
collisions. This new hash is stored in bpf_prog and used by the verifier
to determine if a program can access a given exclusive map.

The original 64-bit tags are kept, as they are used by users as a short,
possibly colliding program identifier for non-security purposes.

Signed-off-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/r/20250914215141.15144-2-kpsingh@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/Kconfig
kernel/bpf/core.c