Re: [PATCH v4 bpf-next 1/2] bpf: properly verify tail call behavior

Teichmann, Martin
2025-11-13T11:46:08Z

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