From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Puranjay Mohan" <puranjay@kernel.org>, <bpf@vger.kernel.org>
Cc: "Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>
Subject: Re: [PATCH bpf-next 1/2] bpf: Look at frame 0 when telling async callback entries apart
Date: Thu, 24 Sep 2026 05:56:10 +0000 [thread overview]
Message-ID: <DLNBCJAQ73G1.3U6JELNSXMQM3@gmail.com> (raw)
In-Reply-To: <20260923140152.4005097-2-puranjay@kernel.org>
On Wed, Sep 23, 2026 at 07:01 AM Puranjay Mohan <puranjay@kernel.org> wrote:
> - struct bpf_func_state *frame = sl->state.frame[sl->state.curframe];
> + struct bpf_func_state *frame = sl->state.frame[0];
>
> if (frame->in_async_callback_fn &&
> - frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) {
> + frame->async_entry_cnt != cur->frame[0]->async_entry_cnt) {
push_callback_call() has the same problem:
caller = state->frame[state->curframe];
...
callee->async_entry_cnt = caller->async_entry_cnt + 1;
When the callback re-arms itself from a subprog the caller is
frame 1 with async_entry_cnt == 0, so every entry into the callback
gets async_entry_cnt == 1 and the check above never skips.
A loop anywhere in such callback is still rejected with
"infinite loop detected".
pw-bot: cr
next prev parent reply other threads:[~2026-09-24 5:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 14:01 [PATCH bpf-next 0/2] bpf: Fix loop detection for re-arming async callbacks Puranjay Mohan
2026-09-23 14:01 ` [PATCH bpf-next 1/2] bpf: Look at frame 0 when telling async callback entries apart Puranjay Mohan
2026-09-24 5:56 ` Alexei Starovoitov [this message]
2026-09-23 14:01 ` [PATCH bpf-next 2/2] selftests/bpf: Add timer tests for a re-arming callback with a loop Puranjay Mohan
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=DLNBCJAQ73G1.3U6JELNSXMQM3@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=puranjay@kernel.org \
--cc=song@kernel.org \
--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 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.