Re: [RFC PATCH v2 16/30] arm64/unwind: Add Minimal DWARF CFI kernel unwinder
From: bot+bpf-ci
Date: Wed Nov 25 2026 - 02:07:13 EST
> arm64/unwind: Add Minimal DWARF CFI kernel unwinder
TL;DR: The module lookup (__module_address) called from the noinstr arm64
stack walkers is unannotated, so kprobes or tracing may re-enter the walker
and RCU may not be watching; no concrete crash found.
> diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
> --- a/arch/arm64/kernel/stacktrace.c
> +++ b/arch/arm64/kernel/stacktrace.c
[ ... ]
> +/**
> + * arm64_dwarf_cfi_module_find() - Look up Minimal DWARF CFI in loadable modules
> + * @pc: Kernel instruction pointer to evaluate.
> + * @row: Output evaluated Minimal DWARF CFI row.
> + *
> + * Uses rcu_read_lock_sched_notrace() and rcu_dereference_raw() so lookups are
> + * safe inside noinstr stack walks and NMI contexts.
> + *
> + * Return: 0 on success, -ENOENT if @pc is not in a module FDE, or a negative
> + * errno on invalid FDE bytecode.
> + */
> +static __always_inline int
> +arm64_dwarf_cfi_module_find(unsigned long pc, struct dwarf_cfi_row *row)
> +{
> + struct mod_dwarf_cfi_index *idx;
> + struct module *mod;
> + int ret;
> +
> + rcu_read_lock_sched_notrace();
> + mod = __module_address(pc);
Is this safe inside the noinstr stack walkers?
arm64_dwarf_cfi_module_find() is __always_inline into arch_stack_walk(),
arch_stack_walk_reliable() and arch_bpf_stack_walk(), which are all
noinline noinstr. But __module_address() is an ordinary out-of-line
function with no noinstr, notrace or NOKPROBE_SYMBOL() annotation, and it
calls mod_find(), which is also unannotated.
The arm64 walker was made noinstr by commit 0fbcd8abf337 ("arm64: Prohibit
instrumentation on arch_stack_walk()") because the stacktrace code can be
used in kprobe context and cannot be safely probed. With
CONFIG_UNWINDER_DWARF_CFI=y, any pc not covered by the vmlinux
.eh_frame_hdr (module text, BPF JIT code, asm without CFI such as the
el1h_64_sync vectors) goes to __module_address(). Can a kprobe, fprobe or
function tracer attached to __module_address() or mod_find() now fire from
inside the walker, for example via a kprobe event with a stacktrace trigger
that re-hits the probe?
Separately, rcu_read_lock_sched_notrace() only skips lockdep and tracing.
It does not make RCU watch, so is the RCU-sched read side section valid
in a noinstr region where RCU may not be watching?
The comment claims the lookup is "safe inside noinstr stack walks and NMI
contexts", and the commit message calls kunwind_next_cfi() "noinstr-safe".
Either the module lookup path needs to be noinstr or kprobe-blacklisted,
or the comment and commit message should drop that claim. I could not
construct a concrete crash through the current kprobe re-entry handling.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45561209846