History

bpf: Implement exclusive map creation

Exclusive maps allow maps to only be accessed by program with a program with a matching hash which is specified in the excl_prog_hash attr. For the signing use-case, this allows the trusted loader program to load the map and verify the integrity

KP Singh committed 1 year ago

Commit baefdbd1 parent 603b4415 files · +46 −4Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/bpf.h+6−0
@@ -1522,6 +1522,12 @@ union bpf_attr { · 1521 unmodified lines
15221522 * If provided, map_flags should have BPF_F_TOKEN_FD flag set.
15231523 */
15241524 __s32 map_token_fd;
1525+
1526+ /* Hash of the program that has exclusive access to the map.
1527+ */
1528+ __aligned_u64 excl_prog_hash;
1529+ /* Size of the passed excl_prog_hash. */
1530+ __u32 excl_prog_hash_size;
15251531 };
15261532
15271533 struct { /* anonymous struct used by BPF_MAP_*_ELEM and BPF_MAP_FREEZE commands */