diff options
author | Mathieu Xhonneux <m.xhonneux@gmail.com> | 2018-05-20 14:58:15 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-24 11:57:36 +0200 |
commit | cd3092c7f8db8c320ea7f1aa7c1adeac2450f43a (patch) | |
tree | 6e5f2d48507ee94eb7ef27175bb1b6debe1a57e0 /include/linux/bpf_types.h | |
parent | fe94cc290f535709d3c5ebd1e472dfd0aec7ee79 (diff) | |
download | linux-cd3092c7f8db8c320ea7f1aa7c1adeac2450f43a.tar.gz linux-cd3092c7f8db8c320ea7f1aa7c1adeac2450f43a.tar.bz2 linux-cd3092c7f8db8c320ea7f1aa7c1adeac2450f43a.zip |
bpf: Split lwt inout verifier structures
The new bpf_lwt_push_encap helper should only be accessible within the
LWT BPF IN hook, and not the OUT one, as this may lead to a skb under
panic.
At the moment, both LWT BPF IN and OUT share the same list of helpers,
whose calls are authorized by the verifier. This patch separates the
verifier ops for the IN and OUT hooks, and allows the IN hook to call the
bpf_lwt_push_encap helper.
This patch is also the occasion to put all lwt_*_func_proto functions
together for clarity. At the moment, socks_op_func_proto is in the middle
of lwt_inout_func_proto and lwt_xmit_func_proto.
Signed-off-by: Mathieu Xhonneux <m.xhonneux@gmail.com>
Acked-by: David Lebrun <dlebrun@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf_types.h')
-rw-r--r-- | include/linux/bpf_types.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h index b67f8793de0d..aa5c8b878474 100644 --- a/include/linux/bpf_types.h +++ b/include/linux/bpf_types.h @@ -9,8 +9,8 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_XDP, xdp) BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SKB, cg_skb) BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK, cg_sock) BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK_ADDR, cg_sock_addr) -BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_inout) -BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_inout) +BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_in) +BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_out) BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_XMIT, lwt_xmit) BPF_PROG_TYPE(BPF_PROG_TYPE_SOCK_OPS, sock_ops) BPF_PROG_TYPE(BPF_PROG_TYPE_SK_SKB, sk_skb) |