1
0
Fork 0
alistair23-linux/include
Andrii Nakryiko 36e68442d1 bpf: Load and verify kernel module BTFs
Add kernel module listener that will load/validate and unload module BTF.
Module BTFs gets ID generated for them, which makes it possible to iterate
them with existing BTF iteration API. They are given their respective module's
names, which will get reported through GET_OBJ_INFO API. They are also marked
as in-kernel BTFs for tooling to distinguish them from user-provided BTFs.

Also, similarly to vmlinux BTF, kernel module BTFs are exposed through
sysfs as /sys/kernel/btf/<module-name>. This is convenient for user-space
tools to inspect module BTF contents and dump their types with existing tools:

[vmuser@archvm bpf]$ ls -la /sys/kernel/btf
total 0
drwxr-xr-x  2 root root       0 Nov  4 19:46 .
drwxr-xr-x 13 root root       0 Nov  4 19:46 ..

...

-r--r--r--  1 root root     888 Nov  4 19:46 irqbypass
-r--r--r--  1 root root  100225 Nov  4 19:46 kvm
-r--r--r--  1 root root   35401 Nov  4 19:46 kvm_intel
-r--r--r--  1 root root     120 Nov  4 19:46 pcspkr
-r--r--r--  1 root root     399 Nov  4 19:46 serio_raw
-r--r--r--  1 root root 4094095 Nov  4 19:46 vmlinux

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/bpf/20201110011932.3201430-5-andrii@kernel.org
2020-11-10 15:25:53 -08:00
..
acpi pci-v5.10-changes 2020-10-22 12:41:00 -07:00
asm-generic Kbuild updates for v5.10 2020-10-22 13:13:57 -07:00
clocksource
crypto X.509: Fix modular build of public_key_sm2 2020-10-08 16:39:14 +11:00
drm sound updates for 5.10 2020-10-15 11:07:44 -07:00
dt-bindings This pull request contains zero diff to the core framework. It is a collection 2020-10-22 12:53:28 -07:00
keys
kunit linux-kselftest-kunit-5.10-rc1 2020-10-18 14:45:59 -07:00
kvm ARM: 2020-10-23 11:17:56 -07:00
linux bpf: Load and verify kernel module BTFs 2020-11-10 15:25:53 -08:00
math-emu
media Linux 5.9-rc7 2020-10-04 12:19:12 +02:00
memory
misc
net Fixes for 5.10-rc1 from the networking tree: 2020-10-23 12:05:49 -07:00
pcmcia
ras mm,hwpoison: introduce MF_MSG_UNSPLIT_THP 2020-10-16 11:11:17 -07:00
rdma RDMA: Explicitly pass in the dma_device to ib_register_device 2020-10-16 13:53:46 -03:00
scsi SCSI misc on 20201013 2020-10-14 15:15:35 -07:00
soc networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
sound ASoC: Updates for v5.10 2020-10-12 16:08:57 +02:00
target
trace ARM: 2020-10-23 11:17:56 -07:00
uapi bpf: Assign ID to vmlinux BTF and return extra info for BTF in GET_OBJ_INFO 2020-11-10 15:25:53 -08:00
vdso
video
xen xen: branch for v5.10-rc1b 2020-10-20 09:24:01 -07:00