aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/filter.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-05-13 19:08:31 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-16 13:49:32 -0400
commitd1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5 (patch)
tree70d10a938de18a64f103de01ab2ffa8a66e52178 /net/core/filter.c
parentbpf: add bpf_patch_insn_single helper (diff)
downloadlinux-dev-d1c55ab5e41fcd72cb0a8bef86d3f652ad9ad9f5.tar.xz
linux-dev-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 'net/core/filter.c')
-rw-r--r--net/core/filter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index ea51b479cf02..68adb5f52110 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -994,7 +994,11 @@ static struct bpf_prog *bpf_migrate_filter(struct bpf_prog *fp)
*/
goto out_err_free;
- bpf_prog_select_runtime(fp);
+ /* We are guaranteed to never error here with cBPF to eBPF
+ * transitions, since there's no issue with type compatibility
+ * checks on program arrays.
+ */
+ fp = bpf_prog_select_runtime(fp, &err);
kfree(old_prog);
return fp;