public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: "Teichmann, Martin" <martin.teichmann@xfel.eu>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, ast <ast@kernel.org>,
	andrii <andrii@kernel.org>
Subject: Re: [PATCH v4 bpf-next 1/2] bpf: properly verify tail call behavior
Date: Thu, 13 Nov 2025 12:46:00 +0100 (CET)	[thread overview]
Message-ID: <745490756.25826958.1763034360662.JavaMail.zimbra@xfel.eu> (raw)
In-Reply-To: <4952b7bf8a0b50352b31bee7ddf89e7809101af6.camel@gmail.com>

Hi Eduard, Hi List,

sorry for the late response.

> This is a clever hack and I like it, but let's not do that.
> It is going to be a footgun if e.g. someone would use
> bpf_insn_successors() to build intra-procedural CFG.

I appreciate the effort you've put into your solution. However, I feel that we might be leaning towards a YAGNI (You Ain't Gonna Need It) situation here. Sure, if somebody wants to do something like your CFG, my "hack" might pose problems. But what if not? In that case, your proposed solution just leads to additional complexity and unused code.

My implementation is quite concise at just three lines, making it straightforward to replace if necessary. It maintains clarity by using BPF_FUNC_tail_call markers, which can help anyone reviewing the code quickly identify its purpose. If someone is not focused on tail calls, they can easily bypass that section, ensuring minimal distractions.

Additionally, I've discovered that the bug in the stack liveness code is actually independent of the bug I’m addressing. My patch doesn’t introduce this issue, so it doesn’t need to resolve it.

In line with the tradition of the Linux kernel of keeping patches small, I can extract my three lines and the corresponding test, allowing us to proceed with my patch as a bug fix. You can then apply your adjustments for the stack liveness issue in your preferred manner.

I hope that helps.

Greetings

Martin

  parent reply	other threads:[~2025-11-13 11:46 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 10:58 [PATCH bpf] bpf: tail calls do not modify packet data Martin Teichmann
2025-10-31 19:24 ` Eduard Zingerman
2025-11-03  8:56   ` Teichmann, Martin
2025-11-03 17:34     ` Eduard Zingerman
2025-11-04 12:54       ` Teichmann, Martin
2025-11-04 13:30   ` [PATCH v2 bpf] bpf: properly verify tail call behavior Martin Teichmann
2025-11-04 13:58     ` bot+bpf-ci
2025-11-04 18:05       ` Alexei Starovoitov
2025-11-04 22:30     ` Eduard Zingerman
2025-11-05 17:40   ` [PATCH v3 bpf-next 0/2] " Martin Teichmann
2025-11-05 19:08     ` Eduard Zingerman
2025-11-06 10:52       ` [PATCH v4 " Martin Teichmann
2025-11-06 10:52       ` [PATCH v4 bpf-next 1/2] " Martin Teichmann
2025-11-06 10:52       ` [PATCH v4 bpf-next 2/2] bpf: test the proper verification of tail calls Martin Teichmann
2025-11-06 19:50         ` Eduard Zingerman
2025-11-10 15:18           ` [PATCH v4 bpf-next 0/2] bpf: properly verify tail call behavior Martin Teichmann
2025-11-10 15:18           ` [PATCH v4 bpf-next 1/2] " Martin Teichmann
2025-11-10 20:28             ` Eduard Zingerman
2025-11-10 23:39               ` Eduard Zingerman
2025-11-13 11:46               ` Teichmann, Martin [this message]
2025-11-13 16:09                 ` Alexei Starovoitov
2025-11-18 13:39               ` [PATCH v5 bpf-next 0/4] " Martin Teichmann
2025-11-18 13:39               ` [PATCH v5 bpf-next 1/4] " Martin Teichmann
2025-11-18 19:34                 ` Eduard Zingerman
2025-11-19 16:03                   ` [PATCH v6 bpf-next 0/4] " Martin Teichmann
2025-11-19 16:03                   ` [PATCH v6 bpf-next 1/4] " Martin Teichmann
2025-11-22  2:00                     ` patchwork-bot+netdevbpf
2025-11-19 16:03                   ` [PATCH v6 bpf-next 2/4] bpf: test the proper verification of tail calls Martin Teichmann
2025-11-19 16:03                   ` [PATCH v6 bpf-next 3/4] bpf: correct stack liveness for " Martin Teichmann
2025-11-19 16:33                     ` bot+bpf-ci
2025-12-12  2:06                     ` Chris Mason
2025-11-19 16:03                   ` [PATCH v6 bpf-next 4/4] bpf: test the correct stack liveness of " Martin Teichmann
2025-11-18 13:39               ` [PATCH v5 bpf-next 2/4] bpf: test the proper verification " Martin Teichmann
2025-11-18 22:47                 ` Eduard Zingerman
2025-11-18 13:39               ` [PATCH v5 bpf-next 3/4] bpf: correct stack liveness for " Martin Teichmann
2025-11-18 22:54                 ` Eduard Zingerman
2025-11-18 13:39               ` [PATCH v5 bpf-next 4/4] bpf: test the correct stack liveness of " Martin Teichmann
2025-11-18 22:55                 ` Eduard Zingerman
2025-11-19  0:13                   ` Alexei Starovoitov
2025-11-10 15:18           ` [PATCH v4 bpf-next 2/2] bpf: test the proper verification " Martin Teichmann
2025-11-10 20:32             ` Eduard Zingerman
2025-11-05 17:40   ` [PATCH v3 bpf-next 1/2] bpf: properly verify tail call behavior Martin Teichmann
2025-11-05 17:40   ` [PATCH v3 bpf-next 2/2] bpf: test the proper verification of tail calls Martin Teichmann

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=745490756.25826958.1763034360662.JavaMail.zimbra@xfel.eu \
    --to=martin.teichmann@xfel.eu \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    /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