diff options
author | 2022-02-04 10:57:39 -0800 | |
---|---|---|
committer | 2022-02-07 18:13:01 -0800 | |
commit | ebc1415d9b4f043cef5a1fb002ec316e32167e7a (patch) | |
tree | bfa0fd9b389bc5a2718a5fafeae0ba390d74ea03 /include/linux/bpf.h | |
parent | x86/alternative: Introduce text_poke_copy (diff) | |
download | linux-ebc1415d9b4f043cef5a1fb002ec316e32167e7a.tar.gz linux-ebc1415d9b4f043cef5a1fb002ec316e32167e7a.tar.bz2 linux-ebc1415d9b4f043cef5a1fb002ec316e32167e7a.zip |
bpf: Introduce bpf_arch_text_copy
This will be used to copy JITed text to RO protected module memory. On
x86, bpf_arch_text_copy is implemented with text_poke_copy.
bpf_arch_text_copy returns pointer to dst on success, and ERR_PTR(errno)
on errors.
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220204185742.271030-7-song@kernel.org
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 366f88afd56b..ea0d7fd4a410 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2362,6 +2362,8 @@ enum bpf_text_poke_type { int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t, void *addr1, void *addr2); +void *bpf_arch_text_copy(void *dst, void *src, size_t len); + struct btf_id_set; bool btf_id_set_contains(const struct btf_id_set *set, u32 id); |