diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-03-20 15:11:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-20 19:10:44 -0400 |
commit | 94caee8c312d96522bcdae88791aaa9ebcd5f22c (patch) | |
tree | 826896381fcc68c6178122c6d098c00729bcbe60 /kernel/bpf | |
parent | 0fa74a4be48e0f810d3dc6ddbc9d6ac7e86cbee8 (diff) | |
download | linux-94caee8c312d96522bcdae88791aaa9ebcd5f22c.tar.gz linux-94caee8c312d96522bcdae88791aaa9ebcd5f22c.tar.bz2 linux-94caee8c312d96522bcdae88791aaa9ebcd5f22c.zip |
ebpf: add sched_act_type and map it to sk_filter's verifier ops
In order to prepare eBPF support for tc action, we need to add
sched_act_type, so that the eBPF verifier is aware of what helper
function act_bpf may use, that it can load skb data and read out
currently available skb fields.
This is bascially analogous to 96be4325f443 ("ebpf: add sched_cls_type
and map it to sk_filter's verifier ops").
BPF_PROG_TYPE_SCHED_CLS and BPF_PROG_TYPE_SCHED_ACT need to be
separate since both will have a different set of functionality in
future (classifier vs action), thus we won't run into ABI troubles
when the point in time comes to diverge functionality from the
classifier.
The future plan for act_bpf would be that it will be able to write
into skb->data and alter selected fields mirrored in struct __sk_buff.
For an initial support, it's sufficient to map it to sk_filter_ops.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Pirko <jiri@resnulli.us>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/verifier.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index c22ebd36fa4b..0e714f799ec0 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1180,6 +1180,7 @@ static bool may_access_skb(enum bpf_prog_type type) switch (type) { case BPF_PROG_TYPE_SOCKET_FILTER: case BPF_PROG_TYPE_SCHED_CLS: + case BPF_PROG_TYPE_SCHED_ACT: return true; default: return false; |