summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorKP Singh <kpsingh@kernel.org>2025-09-15 00:51:35 +0300
committerAlexei Starovoitov <ast@kernel.org>2025-09-19 05:11:42 +0300
commitea2e6467ac36bf3d785defc89e58269b15d182f7 (patch)
tree36a844dc8effdd72fbbf357961b67783f9abd052 /include/uapi
parent6c850cbca82c2d20bc1b1c5e0e1c25c515292abd (diff)
downloadlinux-ea2e6467ac36bf3d785defc89e58269b15d182f7.tar.xz
bpf: Return hashes of maps in BPF_OBJ_GET_INFO_BY_FD
Currently only array maps are supported, but the implementation can be extended for other maps and objects. The hash is memoized only for exclusive and frozen maps as their content is stable until the exclusive program modifies the map. This is required for BPF signing, enabling a trusted loader program to verify a map's integrity. The loader retrieves the map's runtime hash from the kernel and compares it against an expected hash computed at build time. Signed-off-by: KP Singh <kpsingh@kernel.org> Link: https://lore.kernel.org/r/20250914215141.15144-7-kpsingh@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/bpf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 57687b2e1c47..0987b52d5648 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -6672,6 +6672,8 @@ struct bpf_map_info {
__u32 btf_value_type_id;
__u32 btf_vmlinux_id;
__u64 map_extra;
+ __aligned_u64 hash;
+ __u32 hash_size;
} __attribute__((aligned(8)));
struct bpf_btf_info {