From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: <bot+bpf-ci@kernel.org>, <bpf@vger.kernel.org>
Cc: <andrii@kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
<eddyz87@gmail.com>, <martin.lau@kernel.org>, <memxor@gmail.com>,
<song@kernel.org>, <yonghong.song@linux.dev>, <yatsenko@meta.com>,
<clm@meta.com>, <ihor.solodrai@linux.dev>
Subject: Re: [PATCH bpf-next v6 1/2] bpf: Only enforce 8 frame call stack limit for all-static stacks
Date: Mon, 16 Mar 2026 13:23:55 -0400 [thread overview]
Message-ID: <DH4DQIKUEV42.3U48LSI803G6L@etsalapatis.com> (raw)
In-Reply-To: <65e11260b42493b1261ff79a8d2c408cdbe8a68038bea605e1794f75ff406594@mail.kernel.org>
On Mon Mar 16, 2026 at 1:01 PM EDT, bot+bpf-ci wrote:
>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
>> index e29f15419fcb..01c18f4268de 100644
>> --- a/kernel/bpf/verifier.c
>> +++ b/kernel/bpf/verifier.c
>
> [ ... ]
>
>> @@ -6854,7 +6854,16 @@ static int check_max_stack_depth_subprog(struct bpf_verifier_env *env, int idx,
>
> [ ... ]
>
>> - frame++;
>> + frame = subprog_is_global(env, idx) ? 0 : frame + 1;
>> if (frame >= MAX_CALL_FRAMES) {
>> verbose(env, "the call stack of %d frames is too deep !\n",
>> frame);
>
> [ ... ]
>
>> diff --git a/tools/testing/selftests/bpf/progs/test_global_func3.c b/tools/testing/selftests/bpf/progs/test_global_func3.c
>> index 142b682d3c2f..974fd8c19561 100644
>> --- a/tools/testing/selftests/bpf/progs/test_global_func3.c
>> +++ b/tools/testing/selftests/bpf/progs/test_global_func3.c
>
> [ ... ]
>
>> SEC("tc")
>> -__failure __msg("the call stack of 8 frames")
>> +__failure __msg("the call stack of 9 frames")
>> int global_func3(struct __sk_buff *skb)
>> {
>> return f8(skb);
>
> Should the expected message here be "the call stack of 8 frames"
> rather than 9?
>
> The test has 9 functions total (global_func3 plus f1 through f8),
> but only 8 call transitions, and frame starts at 0. Each static
> call increments frame by one:
>
> frame = subprog_is_global(env, idx) ? 0 : frame + 1;
> if (frame >= MAX_CALL_FRAMES) {
> verbose(env, "the call stack of %d frames is too deep !\n",
> frame);
>
> With 8 static calls (global_func3 -> f8 -> f7 -> ... -> f1),
> frame reaches 8 which triggers the check since MAX_CALL_FRAMES
> is 8. The verifier would print "the call stack of 8 frames is
> too deep" and the __msg substring match for "9 frames" would not
> match, causing the test to fail.
>
> The old test with global functions also had 8 call transitions
> and expected "8 frames", since frame++ produced the same value
> of 8 at the limit.
>
Same answer as in the previous version, the test passes fine.
> ---
> 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/23154616737
next prev parent reply other threads:[~2026-03-16 17:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 16:12 [PATCH bpf-next v6 0/2] bpf: Relax 8 frame limitation for global subprogs Emil Tsalapatis
2026-03-16 16:12 ` [PATCH bpf-next v6 1/2] bpf: Only enforce 8 frame call stack limit for all-static stacks Emil Tsalapatis
2026-03-16 17:01 ` bot+bpf-ci
2026-03-16 17:23 ` Emil Tsalapatis [this message]
2026-03-16 16:12 ` [PATCH bpf-next v6 2/2] selftests/bpf: Add deep call stack selftests Emil Tsalapatis
2026-03-16 18:30 ` [PATCH bpf-next v6 0/2] bpf: Relax 8 frame limitation for global subprogs patchwork-bot+netdevbpf
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=DH4DQIKUEV42.3U48LSI803G6L@etsalapatis.com \
--to=emil@etsalapatis.com \
--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=martin.lau@kernel.org \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=yatsenko@meta.com \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox