summaryrefslogtreecommitdiff
path: root/kernel/extable.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-01-23 17:15:07 +0100
committerAlexei Starovoitov <ast@kernel.org>2020-01-25 07:12:40 -0800
commite9b4e606c2289d6610113253922bb8c9ac7f68b0 (patch)
tree93b15ceadb74925c45742b98e876fe573f5bd74a /kernel/extable.c
parent84ad7a7ab69f112c0c4b878c9be91b950a1fb1f8 (diff)
bpf: Allow to resolve bpf trampoline and dispatcher in unwind
When unwinding the stack we need to identify each address to successfully continue. Adding latch tree to keep trampolines for quick lookup during the unwind. The patch uses first 48 bytes for latch tree node, leaving 4048 bytes from the rest of the page for trampoline or dispatcher generated code. It's still enough not to affect trampoline and dispatcher progs maximum counts. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200123161508.915203-3-jolsa@kernel.org
Diffstat (limited to 'kernel/extable.c')
-rw-r--r--kernel/extable.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/extable.c b/kernel/extable.c
index f6920a11e28a..a0024f27d3a1 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -131,8 +131,9 @@ int kernel_text_address(unsigned long addr)
* triggers a stack trace, or a WARN() that happens during
* coming back from idle, or cpu on or offlining.
*
- * is_module_text_address() as well as the kprobe slots
- * and is_bpf_text_address() require RCU to be watching.
+ * is_module_text_address() as well as the kprobe slots,
+ * is_bpf_text_address() and is_bpf_image_address require
+ * RCU to be watching.
*/
no_rcu = !rcu_is_watching();
@@ -148,6 +149,8 @@ int kernel_text_address(unsigned long addr)
goto out;
if (is_bpf_text_address(addr))
goto out;
+ if (is_bpf_image_address(addr))
+ goto out;
ret = 0;
out:
if (no_rcu)