[PATCH net] bpf: change back to orig prog on too many passes

Subsystems: bpf jit for x86 64-bit, bpf [general] (safe dynamic programs and tools), the rest, x86 architecture (32-bit and 64-bit)

STALE3531d REVIEWED: 5 (5M)

1 review trailer (1 from subsystem maintainers).

2 messages, 2 authors, 2017-01-08 · open the first message on its own page

[PATCH net] bpf: change back to orig prog on too many passes

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-01-06 23:27:21

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>
---
 arch/x86/net/bpf_jit_comp.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index e76d1af..bb660e5 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:
-- 
1.9.3

Re: [PATCH net] bpf: change back to orig prog on too many passes

From: David Miller <davem@davemloft.net>
Date: 2017-01-08 22:00:55

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Sat,  7 Jan 2017 00:26:33 +0100
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>
Applied and queued up for -stable, thanks Daniel.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help