diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-05-13 19:08:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-16 13:49:32 -0400 |
commit | d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5 (patch) | |
tree | 70d10a938de18a64f103de01ab2ffa8a66e52178 /lib/test_bpf.c | |
parent | c237ee5eb33bf19fe0591c04ff8db19da7323a83 (diff) | |
download | linux-d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5.tar.gz linux-d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5.tar.bz2 linux-d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5.zip |
bpf: prepare bpf_int_jit_compile/bpf_prog_select_runtime apis
Since the blinding is strictly only called from inside eBPF JITs,
we need to change signatures for bpf_int_jit_compile() and
bpf_prog_select_runtime() first in order to prepare that the
eBPF program we're dealing with can change underneath. Hence,
for call sites, we need to return the latest prog. No functional
change in this patch.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r-- | lib/test_bpf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 8f22fbedc3a6..93f45011a59d 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -5621,7 +5621,10 @@ static struct bpf_prog *generate_filter(int which, int *err) fp->type = BPF_PROG_TYPE_SOCKET_FILTER; memcpy(fp->insnsi, fptr, fp->len * sizeof(struct bpf_insn)); - bpf_prog_select_runtime(fp); + /* We cannot error here as we don't need type compatibility + * checks. + */ + fp = bpf_prog_select_runtime(fp, err); break; } |