BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] infer packet range for 'if pkt ==/!= pkt_end' instructions
@ 2024-01-08 13:27 Eduard Zingerman
  2024-01-08 13:28 ` [PATCH bpf-next 1/3] bpf: simplify try_match_pkt_pointers() Eduard Zingerman
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eduard Zingerman @ 2024-01-08 13:27 UTC (permalink / raw)
  To: bpf, ast
  Cc: andrii, daniel, martin.lau, kernel-team, yonghong.song,
	zenczykowski, Eduard Zingerman

As suggested by Maciej Żenczykowski in [1], extend try_match_pkt_pointers
to allow verification of BPF, generated for C code like below:

  if (data + 42 != data_end) { ... }

Also simplify try_match_pkt_pointers to avoid checking both
'pkt <op> pkt_end' and 'pkt_end <op> pkt' conditions,
as suggested by Andrii Nakryiko.

[1] https://lore.kernel.org/bpf/CAHo-Oow5V2u4ZYvzuR8NmJmFDPNYp0pQDJX66rZqUjFHvhx82A@mail.gmail.com/

Eduard Zingerman (3):
  bpf: simplify try_match_pkt_pointers()
  bpf: infer packet range for 'if pkt ==/!= pkt_end' comparisons
  selftests/bpf: test packet range inference for 'if pkt ==/!= pkt_end'

 kernel/bpf/verifier.c                         | 112 ++++----------
 .../bpf/progs/verifier_direct_packet_access.c | 138 ++++++++++++++++++
 2 files changed, 170 insertions(+), 80 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-01-10 18:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08 13:27 [PATCH bpf-next 0/3] infer packet range for 'if pkt ==/!= pkt_end' instructions Eduard Zingerman
2024-01-08 13:28 ` [PATCH bpf-next 1/3] bpf: simplify try_match_pkt_pointers() Eduard Zingerman
2024-01-09  0:40   ` Andrii Nakryiko
2024-01-09  0:43     ` Andrii Nakryiko
2024-01-09  0:52     ` Eduard Zingerman
2024-01-09 18:22       ` Andrii Nakryiko
2024-01-08 13:28 ` [PATCH bpf-next 2/3] bpf: infer packet range for 'if pkt ==/!= pkt_end' comparisons Eduard Zingerman
2024-01-08 13:49   ` Maciej Żenczykowski
2024-01-08 13:57     ` Eduard Zingerman
2024-01-09  0:45   ` Andrii Nakryiko
2024-01-09  0:57     ` Eduard Zingerman
2024-01-09 18:32       ` Andrii Nakryiko
2024-01-09 17:26   ` Yonghong Song
2024-01-10  1:07     ` Eduard Zingerman
2024-01-10 18:23       ` Eduard Zingerman
2024-01-08 13:28 ` [PATCH bpf-next 3/3] selftests/bpf: test packet range inference for 'if pkt ==/!= pkt_end' Eduard Zingerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox