]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: test the proper verification of tail calls
authorMartin Teichmann <martin.teichmann@xfel.eu>
Wed, 19 Nov 2025 16:03:53 +0000 (17:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 22 Nov 2025 01:45:30 +0000 (17:45 -0800)
commit978da762ea4517da1f4c270eb95bc289f81c176a
tree65ff38b6aab315b11fd93d66fbb2fca192838069
parente3245f8990431950d20631c72236d4e8cb2dcde8
bpf: test the proper verification of tail calls

Three tests are added:

- invalidate_pkt_pointers_by_tail_call checks that one can use the
  packet pointer after a tail call. This was originally possible
  and also poses not problems, but was made impossible by 1a4607ffba35.

- invalidate_pkt_pointers_by_static_tail_call tests a corner case
  found by Eduard Zingerman during the discussion of the original fix,
  which was broken in that fix.

- subprog_result_tail_call tests that precision propagation works
  correctly across tail calls. This did not work before.

Signed-off-by: Martin Teichmann <martin.teichmann@xfel.eu>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20251119160355.1160932-3-martin.teichmann@xfel.eu
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_sock.c
tools/testing/selftests/bpf/progs/verifier_subprog_precision.c