bpf: Implement bpf_local_storage for inodes
authorKP Singh <kpsingh@google.com>
Tue, 25 Aug 2020 18:29:17 +0000 (20:29 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Aug 2020 22:00:04 +0000 (15:00 -0700)
commit8ea636848aca35b9f97c5b5dee30225cf2dd0fe6
treefd26d1b828552b8e1e4dc53fe61e928cfeaf7f61
parent450af8d0f6be2e7dd2a528a3fb054bb726bf1747
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
13 files changed:
include/linux/bpf_lsm.h
include/linux/bpf_types.h
include/uapi/linux/bpf.h
kernel/bpf/Makefile
kernel/bpf/bpf_inode_storage.c [new file with mode: 0644]
kernel/bpf/syscall.c
kernel/bpf/verifier.c
security/bpf/hooks.c
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/map.c
tools/include/uapi/linux/bpf.h
tools/lib/bpf/libbpf_probes.c