summaryrefslogtreecommitdiff
path: root/include/linux/bpf_types.h
diff options
context:
space:
mode:
authorKP Singh <kpsingh@google.com>2020-08-25 20:29:17 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-08-25 15:00:04 -0700
commit8ea636848aca35b9f97c5b5dee30225cf2dd0fe6 (patch)
treefd26d1b828552b8e1e4dc53fe61e928cfeaf7f61 /include/linux/bpf_types.h
parent450af8d0f6be2e7dd2a528a3fb054bb726bf1747 (diff)
bpf: Implement bpf_local_storage for inodes
Similar to bpf_local_storage for sockets, add local storage for inodes. The life-cycle of storage is managed with the life-cycle of the inode. i.e. the storage is destroyed along with the owning inode. The BPF LSM allocates an __rcu pointer to the bpf_local_storage in the security blob which are now stackable and can co-exist with other LSMs. Signed-off-by: KP Singh <kpsingh@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200825182919.1118197-6-kpsingh@chromium.org
Diffstat (limited to 'include/linux/bpf_types.h')
-rw-r--r--include/linux/bpf_types.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
index a52a5688418e..2e6f568377f1 100644
--- a/include/linux/bpf_types.h
+++ b/include/linux/bpf_types.h
@@ -107,6 +107,9 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
#endif
+#ifdef CONFIG_BPF_LSM
+BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops)
+#endif
BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
#if defined(CONFIG_XDP_SOCKETS)
BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)