bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] check bpf_func_state->callback_depth when pruning states
@ 2024-02-16 15:03 Eduard Zingerman
  2024-02-16 15:03 ` [PATCH bpf-next v2 1/3] selftests/bpf: update tcp_custom_syncookie to use scalar packet offset Eduard Zingerman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eduard Zingerman @ 2024-02-16 15:03 UTC (permalink / raw)
  To: bpf, ast
  Cc: andrii, daniel, martin.lau, kernel-team, yonghong.song, kuniyu,
	Eduard Zingerman

This patch-set fixes bug in states pruning logic hit in mailing list
discussion [0]. The details of the fix are in patch #2.
A change to the test case test_tcp_custom_syncookie.c is necessary,
otherwise updated verifier won't be able to process it due to
instruction complexity limit. This change is done in patch #1.

The main idea for the fix belongs to Yonghong Song,
mine contribution is merely in review and test cases.

There are some changes in verification performance:

File                       Program   Insns   (DIFF)  States (A)  States (B)  States (DIFF)
-------------------------  --------  --------------  ----------  ----------  -------------
pyperf600_bpf_loop.bpf.o   on_event    +53 (+1.09%)         323         330    +7 (+2.17%)
strobemeta_bpf_loop.bpf.o  on_event  +594 (+27.85%)         163         213  +50 (+30.67%)

(when tested using BPF selftests and Cilium object files)

Changelog:
v1 [1] -> v2:
- patch #2 commit message updated to better reflect verifier behavior
  with regards to checkpoints tree (suggested by Yonghong);
- veristat results added (suggested by Andrii).

[0] https://lore.kernel.org/bpf/9b251840-7cb8-4d17-bd23-1fc8071d8eef@linux.dev/
[1] https://lore.kernel.org/bpf/20240212143832.28838-1-eddyz87@gmail.com/

Eduard Zingerman (3):
  selftests/bpf: update tcp_custom_syncookie to use scalar packet offset
  bpf: check bpf_func_state->callback_depth when pruning states
  selftests/bpf: test case for callback_depth states pruning logic

 kernel/bpf/verifier.c                         |  3 +
 .../bpf/progs/test_tcp_custom_syncookie.c     | 83 ++++++++++++-------
 .../bpf/progs/verifier_iterating_callbacks.c  | 70 ++++++++++++++++
 3 files changed, 126 insertions(+), 30 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-20  0:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 15:03 [PATCH bpf-next v2 0/3] check bpf_func_state->callback_depth when pruning states Eduard Zingerman
2024-02-16 15:03 ` [PATCH bpf-next v2 1/3] selftests/bpf: update tcp_custom_syncookie to use scalar packet offset Eduard Zingerman
2024-02-16 15:03 ` [PATCH bpf-next v2 2/3] bpf: check bpf_func_state->callback_depth when pruning states Eduard Zingerman
2024-02-16 18:16   ` Andrii Nakryiko
2024-02-17 18:19     ` Eduard Zingerman
2024-02-19 12:48       ` Eduard Zingerman
2024-02-20  0:30         ` Yonghong Song
2024-02-16 15:03 ` [PATCH bpf-next v2 3/3] selftests/bpf: test case for callback_depth states pruning logic Eduard Zingerman
2024-02-20  0:32   ` Yonghong Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).