From: Yonghong Song <yonghong.song@linux.dev>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
eddyz87@gmail.com, kernel-team@fb.com, martin.lau@kernel.org,
clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v3 08/11] selftests/bpf: Check the member named for an unsupported kfunc return type
Date: Fri, 28 Aug 2026 11:20:56 -0700 [thread overview]
Message-ID: <30814c10-1db6-45f1-8a22-5adb7af78a58@linux.dev> (raw)
In-Reply-To: <a029d698010cf5a0306af0758d0b2d9454903521e299f0c84bc0c26864618168@mail.kernel.org>
On 8/27/26 12:04 AM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/tools/testing/selftests/bpf/progs/aggregate_ret_kfunc.c b/tools/testing/selftests/bpf/progs/aggregate_ret_kfunc.c
>> index f10e5cf6fd890..e9c82df8efb26 100644
>> --- a/tools/testing/selftests/bpf/progs/aggregate_ret_kfunc.c
>> +++ b/tools/testing/selftests/bpf/progs/aggregate_ret_kfunc.c
> [ ... ]
>
>> @@ -72,6 +74,7 @@ __naked int aggregate_ret_kfunc_fastcall_fail(void)
>> SEC("tc")
>> __arch_x86_64 __arch_arm64
>> __failure __msg("is not composed of scalars or arena pointers")
>> +__msg("member 'p' has type PTR")
>> __naked int aggregate_ret_kfunc_ptr_fail(void)
> [ ... ]
>
>> @@ -84,6 +87,37 @@ __naked int aggregate_ret_kfunc_ptr_fail(void)
>> : __clobber_all);
>> }
>>
>> +SEC("tc")
>> +__arch_x86_64 __arch_arm64
>> +__failure __msg("is not composed of scalars or arena pointers")
>> +__msg("member 'in.p' has type PTR")
>> +__naked int aggregate_ret_kfunc_nested_ptr_fail(void)
> [ ... ]
>
>> +SEC("tc")
>> +__arch_x86_64 __arch_arm64
>> +__failure __msg("max struct nesting depth exceeded")
>> +__naked int aggregate_ret_kfunc_too_deep_fail(void)
>> +{
>> + asm volatile (
>> + "r1 = 0;"
>> + "call %[bpf_kfunc_call_test_ret_deep];"
>> + "r0 = 0;"
>> + "exit;"
>> + :
>> + : __imm(bpf_kfunc_call_test_ret_deep)
>> + : __clobber_all);
>> +}
> A subsystem pattern flags this as potentially concerning: the commit
> message states the third case covers "a type nested deeper than the
> walk descends, which has no single member to blame and reports the
> depth instead." But the test's only assertion, __msg("max struct
> nesting depth exceeded"), pins a string that predates the series.
>
> Looking at the verifier code, the depth report text ' It nests structs
> more than %d levels deep.' was added by commit b99471ca9c385, and
> unlike the member case there is no verbose() counterpart for it - it
> is only emitted through bpf_diag_program_structure(). This diagnostic
> output is reachable to __msg since libbpf retries a failed load at
> log_level 1.
>
> If the new path->too_deep assignment and the entire 'if (path.too_deep)'
> branch were deleted, path.depth would still be 0 (the too-deep return
> bypasses the bad_member/bad_path labels), member_note would stay "",
> and nothing else would change in the log. The test would still pass even
> though the new behavior was not present.
>
> The two sibling tests don't have this problem - 'member 'p' has type
> PTR' and 'member 'in.p' has type PTR' are both new strings from
> b99471ca9c385 and directly verify that the kernel names the member
> correctly. The too_deep test also omits the __msg("is not composed of
> scalars or arena pointers") anchor that both siblings carry, so it does
> not even pin that the failure came from the kfunc-return path.
>
> Would adding an assertion on the depth diagnostic text plus the anchor
> message make the case more discriminating?
I would like to keep it as is. For path.too_deep, we do not need to
have member names. The user only needs to take a look at the top
struct which is already available.
>
> [ ... ]
>
>
> ---
> 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/33045482525
next prev parent reply other threads:[~2026-08-28 18:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 6:11 [PATCH bpf-next v3 00/11] bpf: Allow arena pointers in by-value returns Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 01/11] bpf: Record each half of a paired return value in verifier diagnostics Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 02/11] bpf: Drop the recursion depth argument of btf_type_is_scalar_struct() Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 17:39 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 03/11] bpf: Add btf_type_is_arena_ptr() Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 04/11] bpf: Let the by-value struct walk take the kinds of member it accepts Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 05/11] bpf: Report which member makes a kfunc return type unsupported Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 17:45 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 06/11] bpf: Allow a global function to return arena pointers by value Yonghong Song
2026-08-27 6:33 ` sashiko-bot
2026-08-28 18:00 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 07/11] bpf: Allow arena pointers in a by-value kfunc return Yonghong Song
2026-08-27 6:55 ` sashiko-bot
2026-08-28 18:10 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 08/11] selftests/bpf: Check the member named for an unsupported kfunc return type Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 18:20 ` Yonghong Song [this message]
2026-08-27 6:12 ` [PATCH bpf-next v3 09/11] selftests/bpf: Test global functions returning arena pointers by value Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 18:26 ` Yonghong Song
2026-08-27 6:12 ` [PATCH bpf-next v3 10/11] selftests/bpf: Test kfuncs " Yonghong Song
2026-08-27 7:17 ` bot+bpf-ci
2026-08-28 18:28 ` Yonghong Song
2026-08-27 6:12 ` [PATCH bpf-next v3 11/11] docs/bpf: Document arena pointers in a by-value return Yonghong Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30814c10-1db6-45f1-8a22-5adb7af78a58@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.