]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/bpf: Write protect JIT code
authorJordan Niethe <jniethe5@gmail.com>
Wed, 9 Jun 2021 01:34:28 +0000 (11:34 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 21 Jun 2021 11:13:21 +0000 (21:13 +1000)
commitdd2617f724ea642b44aa7d8deb1b1f1fd4984c47
tree4cf3f9961c53c4a2b09f96c7840e3542f1b1a0cd
parent92d997984e2f0f234548b42cb4c7df605bc6a8d7
powerpc/bpf: Write protect JIT code

Add the necessary call to bpf_jit_binary_lock_ro() to remove write and
add exec permissions to the JIT image after it has finished being
written.

Without CONFIG_STRICT_MODULE_RWX the image will be writable and
executable until the call to bpf_jit_binary_lock_ro().

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210609013431.9805-7-jniethe5@gmail.com
arch/powerpc/net/bpf_jit_comp.c