]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/bpf: Flush the entire JIT buffer
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Fri, 13 Jan 2017 17:10:01 +0000 (22:40 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Jan 2017 02:34:25 +0000 (13:34 +1100)
commit0305a3dfe7e3f3cb7a297ff6347f7fbd14f3a4ce
tree0090ade810bad3e98245d55d6c784c21b63d0d53
parent249768625167c0e18e53acabccdaf52c287188ec
powerpc/bpf: Flush the entire JIT buffer

With bpf_jit_binary_alloc(), we allocate at a page granularity and fill
the rest of the space with illegal instructions to mitigate BPF spraying
attacks, while having the actual JIT'ed BPF program at a random location
within the allocated space. Under this scenario, it would be better to
flush the entire allocated buffer rather than just the part containing
the actual program. We already flush the buffer from start to the end of
the BPF program. Extend this to include the illegal instructions after
the BPF program.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/net/bpf_jit_comp64.c