diff options
| author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-08-16 03:57:33 +0200 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-08-17 11:58:22 +0200 |
| commit | 09a0c2d678643aa8362ed83ea21b3a21566b318a (patch) | |
| tree | 50081374446fff2de0951c064178d75c9a79fd62 | |
| parent | b26c0b2dd5195f3397e7f64fefc9c190ebba7204 (diff) | |
bpf: Use canonical stack argument names in diagnostics
The main diagnostic identifies the first outgoing stack slot as stack
argument 1 and the sixth function argument. The causal history instead
labels the same value as stack arg6, making it look like a different slot.
Render causal-history targets in the verifier's canonical stack-argument
location form. The first outgoing slot is now shown as *(R11-8), matching
reg_arg_name(), while the main diagnostic retains its fuller slot and
ordinal description.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/eb1be5327d136b7e5bd6d68e76fef6de20c40790.camel@gmail.com
Link: https://lore.kernel.org/bpf/20260816015746.2632990-6-memxor@gmail.com
| -rw-r--r-- | kernel/bpf/diagnostics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/diagnostics.c b/kernel/bpf/diagnostics.c index 33b7d9e8e2c3..b24be9df5fab 100644 --- a/kernel/bpf/diagnostics.c +++ b/kernel/bpf/diagnostics.c @@ -2164,7 +2164,7 @@ static const char *diag_mod_target_desc(struct bpf_verifier_env *env, case BPF_DIAG_MOD_TARGET_REG: return bpf_diag_fmt(env, "R%u", target->regno); case BPF_DIAG_MOD_TARGET_STACK_ARG: - return bpf_diag_fmt(env, "stack arg%d", diag_stack_argno(target->stack_arg)); + return bpf_diag_fmt(env, "*(R11-%u)", (target->stack_arg + 1) * BPF_REG_SIZE); case BPF_DIAG_MOD_TARGET_STACK_SLOT: return bpf_diag_fmt(env, "stack slot fp%d", -(target->spi + 1) * BPF_REG_SIZE); default: |
