diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2025-12-09 23:28:49 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-12-09 23:30:27 -0800 |
| commit | 297c3fba9d766b52b6b8e99fa53f0a85c5902909 (patch) | |
| tree | f02df38dd46e62838ff4a59bac510defbd5e2a79 /kernel | |
| parent | 189e5deb944a6f9c7992355d60bffd8ec2e54a9c (diff) | |
| parent | 01bc3b6db18d6e0a2e93c37885996bf339bfe337 (diff) | |
Merge branch 'bpf-x86-unwind-orc-support-reliable-unwinding-through-bpf-stack-frames'
Josh Poimboeuf says:
====================
bpf, x86/unwind/orc: Support reliable unwinding through BPF stack frames
Fix livepatch stalls which may be seen when a task is blocked with BPF
JIT on its kernel stack.
Changes since v1 (https://lore.kernel.org/cover.1764699074.git.jpoimboe@kernel.org):
- fix NULL ptr deref in __arch_prepare_bpf_trampoline()
====================
Link: https://patch.msgid.link/cover.1764818927.git.jpoimboe@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/bpf/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index c8ae6ab31651..1b9b18e5b03c 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -760,6 +760,22 @@ struct bpf_prog *bpf_prog_ksym_find(unsigned long addr) NULL; } +bool bpf_has_frame_pointer(unsigned long ip) +{ + struct bpf_ksym *ksym; + unsigned long offset; + + guard(rcu)(); + + ksym = bpf_ksym_find(ip); + if (!ksym || !ksym->fp_start || !ksym->fp_end) + return false; + + offset = ip - ksym->start; + + return offset >= ksym->fp_start && offset < ksym->fp_end; +} + const struct exception_table_entry *search_bpf_extables(unsigned long addr) { const struct exception_table_entry *e = NULL; |
