]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
bpf: Split lwt inout verifier structures
authorMathieu Xhonneux <m.xhonneux@gmail.com>
Sun, 20 May 2018 13:58:15 +0000 (14:58 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 May 2018 09:57:36 +0000 (11:57 +0200)
commitcd3092c7f8db8c320ea7f1aa7c1adeac2450f43a
tree6e5f2d48507ee94eb7ef27175bb1b6debe1a57e0
parentfe94cc290f535709d3c5ebd1e472dfd0aec7ee79
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>
include/linux/bpf_types.h
net/core/filter.c