BPF_PROG_TYPE(BPF_PROG_TYPE_LSM, lsm, void *, void *) #endif /* CONFIG_BPF_LSM */ #endif BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops) 2 changes: 2 additions & 0 deletions 2 include/uapi/linux/bpf.h Original file line numberDiff line numberDiff line change @@ -181,6 +...
BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_SK_REUSEPORT, BPF_PROG_TYPE_FLOW_DISSECTOR, BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, BPF_PROG_TYPE_CGROUP_SOCKOPT, BPF_PROG_TYPE_TRACING, BPF_PROG_TYPE_STRUCT_OPS, BPF_PROG_TYPE_EXT, BPF_PROG_TYPE_LSM, BPF_PROG_TYPE...
LSM_HOOK(void, LSM_RET_VOID, bpf_map_free_security, struct bpf_map *map) LSM_HOOK(int, 0, bpf_prog_alloc_security, struct bpf_prog_aux *aux) LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux) #endif /* CONFIG_BPF_SYSCALL */ 在继续并尝试编写 LSM ...
183 BPF_PROG_TYPE_SK_REUSEPORT, 184 BPF_PROG_TYPE_FLOW_DISSECTOR, 185 BPF_PROG_TYPE_CGROUP_SYSCTL, 186 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, 187 BPF_PROG_TYPE_CGROUP_SOCKOPT, 188 BPF_PROG_TYPE_TRACING, 189 BPF_PROG_TYPE_STRUCT_OPS, 190 BPF_PROG_TYPE_EXT, 191 BPF_PROG_TYPE_LSM, ...
return BPF_PROG_TYPE_LSM; case BPF_TCX_INGRESS: case BPF_TCX_EGRESS: case BPF_NETKIT_PRIMARY: case BPF_NETKIT_PEER: return BPF_PROG_TYPE_SCHED_CLS; default: return BPF_PROG_TYPE_UNSPEC; @@ -3781,7 +3784,9 @@ static int bpf_prog_attach_check_attach_type(const struct bpf_prog *p...
183 BPF_PROG_TYPE_SK_REUSEPORT, 184 BPF_PROG_TYPE_FLOW_DISSECTOR, 185 BPF_PROG_TYPE_CGROUP_SYSCTL, 186 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, 187 BPF_PROG_TYPE_CGROUP_SOCKOPT, 188 BPF_PROG_TYPE_TRACING, 189 BPF_PROG_TYPE_STRUCT_OPS, 190 BPF_PROG_TYPE_EXT, 191 BPF_PROG_TYPE_LSM, ...
LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security, struct bpf_prog_aux *aux)#endif /* CONFIG_BPF_SYSCALL */ 在继续并尝试编写 LSM BPF 程序之前,请确保: 内核版本至少为 5.7; LSM BPF 已启用。 LSM BPF 的启用可以通过以下方式进行验证,正确的输出应包含 bpf: $ grep CONFIG_BPF_LSM /...
tokio-runtime-w-1666[003]1318.058019:funcgraph_entry:|bpf_trampoline_link_prog(){ tokio-runtime-w-1666[003]1318.058020:funcgraph_entry:2.292us|bpf_attach_type_to_tramp(); tokio-runtime-w-1666[003]1318.058024:funcgraph_entry:1.250us|mutex_lock(); ...
tokio-runtime-w-1666 [003] 1318.058019: funcgraph_entry: | bpf_trampoline_link_prog() { tokio-runtime-w-1666 [003] 1318.058020: funcgraph_entry: 2.292 us | bpf_attach_type_to_tramp(); tokio-runtime-w-1666 [003] 1318.058024: funcgraph_entry: 1.250 us | mutex_lock(); ...
prog_array 是 perf_event_array 是 percpu_hash 是 percpu_array 是 stack_trace 是 cgroup_array 是 lru_hash 是 lru_percpu_hash 是 lpm_trie 是 array_of_maps 是 hash_of_maps 是 devmap 是 sockmap 是 cpumap 是 xskmap 是 sockhash ...