History

bpf: Add bpf_arch_text_poke() helper

Add bpf_arch_text_poke() helper that is used by BPF trampoline logic to patch nops/calls in kernel text into calls into BPF trampoline and to patch calls/nops inside BPF programs too.

Alexei Starovoitov committed 7 years ago

Commit 5964b201 parent 3b2744e3 files · +65 −0Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/bpf.h+8−0
@@ -1157,4 +1157,12 @@ static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type, · 1156 unmodified lines
11571157 }
11581158 #endif /* CONFIG_INET */
11591159
1160+enum bpf_text_poke_type {
1161+ BPF_MOD_NOP_TO_CALL,
1162+ BPF_MOD_CALL_TO_CALL,
1163+ BPF_MOD_CALL_TO_NOP,
1164+};
1165+int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
1166+ void *addr1, void *addr2);
1167+
11601168 #endif /* _LINUX_BPF_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t