diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/bpf.h | 4 | ||||
| -rw-r--r-- | include/linux/filter.h | 1 | ||||
| -rw-r--r-- | include/uapi/asm-generic/socket.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/bpf.h | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 75e94eaa228b..bbfceb756452 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
| @@ -128,7 +128,11 @@ struct bpf_prog_aux { | |||
| 128 | struct work_struct work; | 128 | struct work_struct work; |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | #ifdef CONFIG_BPF_SYSCALL | ||
| 131 | void bpf_prog_put(struct bpf_prog *prog); | 132 | void bpf_prog_put(struct bpf_prog *prog); |
| 133 | #else | ||
| 134 | static inline void bpf_prog_put(struct bpf_prog *prog) {} | ||
| 135 | #endif | ||
| 132 | struct bpf_prog *bpf_prog_get(u32 ufd); | 136 | struct bpf_prog *bpf_prog_get(u32 ufd); |
| 133 | /* verify correctness of eBPF program */ | 137 | /* verify correctness of eBPF program */ |
| 134 | int bpf_check(struct bpf_prog *fp, union bpf_attr *attr); | 138 | int bpf_check(struct bpf_prog *fp, union bpf_attr *attr); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index ca95abd2bed1..caac2087a4d5 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -381,6 +381,7 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog); | |||
| 381 | void bpf_prog_destroy(struct bpf_prog *fp); | 381 | void bpf_prog_destroy(struct bpf_prog *fp); |
| 382 | 382 | ||
| 383 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 383 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
| 384 | int sk_attach_bpf(u32 ufd, struct sock *sk); | ||
| 384 | int sk_detach_filter(struct sock *sk); | 385 | int sk_detach_filter(struct sock *sk); |
| 385 | 386 | ||
| 386 | int bpf_check_classic(const struct sock_filter *filter, unsigned int flen); | 387 | int bpf_check_classic(const struct sock_filter *filter, unsigned int flen); |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index f541ccefd4ac..5c15c2a5c123 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
| @@ -84,4 +84,7 @@ | |||
| 84 | 84 | ||
| 85 | #define SO_INCOMING_CPU 49 | 85 | #define SO_INCOMING_CPU 49 |
| 86 | 86 | ||
| 87 | #define SO_ATTACH_BPF 50 | ||
| 88 | #define SO_DETACH_BPF SO_DETACH_FILTER | ||
| 89 | |||
| 87 | #endif /* __ASM_GENERIC_SOCKET_H */ | 90 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 4a3d0f84f178..45da7ec7d274 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -117,6 +117,7 @@ enum bpf_map_type { | |||
| 117 | 117 | ||
| 118 | enum bpf_prog_type { | 118 | enum bpf_prog_type { |
| 119 | BPF_PROG_TYPE_UNSPEC, | 119 | BPF_PROG_TYPE_UNSPEC, |
| 120 | BPF_PROG_TYPE_SOCKET_FILTER, | ||
| 120 | }; | 121 | }; |
| 121 | 122 | ||
| 122 | /* flags for BPF_MAP_UPDATE_ELEM command */ | 123 | /* flags for BPF_MAP_UPDATE_ELEM command */ |
