diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-03-01 06:31:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-01 14:05:19 -0500 |
commit | 24701ecea76b0b93bd9667486934ec310825f558 (patch) | |
tree | 7f658077fea363e89643d95fc808236d748b8431 /kernel/bpf/verifier.c | |
parent | 96be4325f443dbbfeb37d2a157675ac0736531a1 (diff) |
ebpf: move read-only fields to bpf_prog and shrink bpf_prog_aux
is_gpl_compatible and prog_type should be moved directly into bpf_prog
as they stay immutable during bpf_prog's lifetime, are core attributes
and they can be locked as read-only later on via bpf_prog_select_runtime().
With a bit of rearranging, this also allows us to shrink bpf_prog_aux
to exactly 1 cacheline.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 594d341f04db..bdf4192a889b 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c | |||
@@ -852,7 +852,7 @@ static int check_call(struct verifier_env *env, int func_id) | |||
852 | } | 852 | } |
853 | 853 | ||
854 | /* eBPF programs must be GPL compatible to use GPL-ed functions */ | 854 | /* eBPF programs must be GPL compatible to use GPL-ed functions */ |
855 | if (!env->prog->aux->is_gpl_compatible && fn->gpl_only) { | 855 | if (!env->prog->gpl_compatible && fn->gpl_only) { |
856 | verbose("cannot call GPL only function from proprietary program\n"); | 856 | verbose("cannot call GPL only function from proprietary program\n"); |
857 | return -EINVAL; | 857 | return -EINVAL; |
858 | } | 858 | } |
@@ -1205,7 +1205,7 @@ static int check_ld_abs(struct verifier_env *env, struct bpf_insn *insn) | |||
1205 | struct reg_state *reg; | 1205 | struct reg_state *reg; |
1206 | int i, err; | 1206 | int i, err; |
1207 | 1207 | ||
1208 | if (!may_access_skb(env->prog->aux->prog_type)) { | 1208 | if (!may_access_skb(env->prog->type)) { |
1209 | verbose("BPF_LD_ABS|IND instructions not allowed for this program type\n"); | 1209 | verbose("BPF_LD_ABS|IND instructions not allowed for this program type\n"); |
1210 | return -EINVAL; | 1210 | return -EINVAL; |
1211 | } | 1211 | } |