summaryrefslogtreecommitdiffstats
path: root/arch/x86/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorDaniel Borkmann2017-01-07 00:26:33 +0100
committerDavid S. Miller2017-01-08 23:00:18 +0100
commit9d5ecb09d525469abd1a10c096cb5a17206523f2 (patch)
tree6596162007a93575bf50a08acb35a68ab7a5ba82 /arch/x86/net/bpf_jit_comp.c
parenttg3: Fix race condition in tg3_get_stats64(). (diff)
downloadkernel-qcow2-linux-9d5ecb09d525469abd1a10c096cb5a17206523f2.tar.gz
kernel-qcow2-linux-9d5ecb09d525469abd1a10c096cb5a17206523f2.tar.xz
kernel-qcow2-linux-9d5ecb09d525469abd1a10c096cb5a17206523f2.zip
bpf: change back to orig prog on too many passes
If after too many passes still no image could be emitted, then swap back to the original program as we do in all other cases and don't use the one with blinding. Fixes: 959a75791603 ("bpf, x86: add support for constant blinding") 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 'arch/x86/net/bpf_jit_comp.c')
-rw-r--r--arch/x86/net/bpf_jit_comp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index e76d1af60f7a..bb660e53cbd6 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1172,6 +1172,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
set_memory_ro((unsigned long)header, header->pages);
prog->bpf_func = (void *)image;
prog->jited = 1;
+ } else {
+ prog = orig_prog;
}
out_addrs: