bpf, x86: Generalize and extend bpf_arch_text_poke for direct jumps
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Nov 2019 20:07:54 +0000 (21:07 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2019 00:58:47 +0000 (16:58 -0800)
commit4b3da77b72ad6b3c48c6fe4a395ace7db39a12c5
tree3c65c1076f917574a67c3ee1c4de18364549bebc
parentc4781e37c6a22c39cb4a57411d14f42aca124f04
bpf, x86: Generalize and extend bpf_arch_text_poke for direct jumps

Add BPF_MOD_{NOP_TO_JUMP,JUMP_TO_JUMP,JUMP_TO_NOP} patching for x86
JIT in order to be able to patch direct jumps or nop them out. We need
this facility in order to patch tail call jumps and in later work also
BPF static keys.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/aa4784196a8e5e985af4b30a4fe5336bce6e9643.1574452833.git.daniel@iogearbox.net
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h