aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/bpf.txt.const
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2024-09-09 19:39:22 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-09-11 15:44:33 +0000
commit709979145c8aad814397b9314d5bd44d9e2ccc1d (patch)
tree7f4e6782cafc1a6ec5e009bf4cf21d72f4f63179 /sys/linux/bpf.txt.const
parentfd6ac064b455d73026e1a082d723711015a6aa6b (diff)
sys/linux: improve precision of BPF attach targets
How the attach target field is interpreted depends on the program type [1], which itself depends on the attach type [2] (defined in attach_type_to_prog_type upstream). This commit encodes the same in syzkaller to make the attach target field more precise. Because attach_type_to_prog_type is a simple n to 1 mapping, we can encode it as defines. We can then use those defines in conditional fields for the different types of attach targets. 1 - https://elixir.bootlin.com/linux/v6.10.9/source/kernel/bpf/syscall.c#L4098 2 - https://elixir.bootlin.com/linux/v6.10.9/source/kernel/bpf/syscall.c#L3913 Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys/linux/bpf.txt.const')
-rw-r--r--sys/linux/bpf.txt.const18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const
index c95f44494..7b2885431 100644
--- a/sys/linux/bpf.txt.const
+++ b/sys/linux/bpf.txt.const
@@ -242,6 +242,24 @@ BTF_KIND_VAR = 14
BTF_KIND_VOLATILE = 9
BTF_MAGIC = 60319
BTF_VERSION = 1
+EXP_CGROUP = 63
+EXP_MAP = 39
+EXP_TYPE_CGROUP_DEVICE = 6
+EXP_TYPE_CGROUP_SKB = 1
+EXP_TYPE_CGROUP_SOCK = 47
+EXP_TYPE_CGROUP_SOCKOPT = 23
+EXP_TYPE_CGROUP_SOCK_ADDR = 63
+EXP_TYPE_CGROUP_SYSCTL = 18
+EXP_TYPE_FLOW_DISSECTOR = 17
+EXP_TYPE_LIRC_MODE2 = 16
+EXP_TYPE_LSM = 59
+EXP_TYPE_SCHED_CLS = 63
+EXP_TYPE_SK_LOOKUP = 36
+EXP_TYPE_SK_MSG = 7
+EXP_TYPE_SK_SKB = 39
+EXP_TYPE_SOCK_OPS = 3
+EXP_TYPE_TRACING = 31
+EXP_TYPE_XDP = 37
MAX_FUNCINFO_REC_SIZE = 252
MIN_BPF_FUNCINFO_SIZE = 8
NF_NETDEV_EGRESS = 1