summaryrefslogtreecommitdiffstats
path: root/arch/arm64/net
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2017-12-14 20:55:14 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2017-12-17 14:34:36 -0500
commit60b58afc96c9df71871df2dbad42037757ceef26 (patch)
tree5651c4845120fc28c9712f53f31962adfd4abe73 /arch/arm64/net
parent1ea47e01ad6ea0fe99697c54c2413d81dd21fe32 (diff)
bpf: fix net.core.bpf_jit_enable race
global bpf_jit_enable variable is tested multiple times in JITs, blinding and verifier core. The malicious root can try to toggle it while loading the programs. This race condition was accounted for and there should be no issues, but it's safer to avoid this race condition. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'arch/arm64/net')
-rw-r--r--arch/arm64/net/bpf_jit_comp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index ba38d403abb2..288137cb0871 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -844,7 +844,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
844 int image_size; 844 int image_size;
845 u8 *image_ptr; 845 u8 *image_ptr;
846 846
847 if (!bpf_jit_enable) 847 if (!prog->jit_requested)
848 return orig_prog; 848 return orig_prog;
849 849
850 tmp = bpf_jit_blind_constants(prog); 850 tmp = bpf_jit_blind_constants(prog);