From 09a0c2d678643aa8362ed83ea21b3a21566b318a Mon Sep 17 00:00:00 2001 From: Kumar Kartikeya Dwivedi Date: Sun, 16 Aug 2026 03:57:33 +0200 Subject: [PATCH] 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 Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/eb1be5327d136b7e5bd6d68e76fef6de20c40790.camel@gmail.com Link: https://lore.kernel.org/bpf/20260816015746.2632990-6-memxor@gmail.com --- kernel/bpf/diagnostics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: