BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/4] bpf: make trusted args nullable
@ 2024-05-10 12:28 Vadim Fedorenko
  2024-05-10 12:28 ` [PATCH bpf-next v2 1/4] bpf: verifier: make kfuncs args nullalble Vadim Fedorenko
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Vadim Fedorenko @ 2024-05-10 12:28 UTC (permalink / raw)
  To: Vadim Fedorenko, Martin KaFai Lau, Andrii Nakryiko,
	Alexei Starovoitov, Mykola Lysenko, Jakub Kicinski
  Cc: Vadim Fedorenko, bpf

Current verifier checks for the arg to be nullable after checking for
certain pointer types. It prevents programs to pass NULL to kfunc args
even if they are marked as nullable. This patchset adjusts verifier and
changes bpf crypto kfuncs to allow null for IV parameter which is
optional for some ciphers. Benchmark shows ~4% improvements when there
is no need to initialise 0-sized dynptr.

v2:
- adjust kdoc accordingly

Vadim Fedorenko (4):
  bpf: verifier: make kfuncs args nullalble
  bpf: crypto: make state and IV dynptr nullable
  selftests: bpf: crypto: use NULL instead of 0-sized dynptr
  selftests: bpf: crypto: adjust bench to use nullable IV

 kernel/bpf/crypto.c                           | 26 +++++++++----------
 kernel/bpf/verifier.c                         |  6 ++---
 .../selftests/bpf/progs/crypto_bench.c        | 10 +++----
 .../selftests/bpf/progs/crypto_sanity.c       | 16 +++---------
 4 files changed, 24 insertions(+), 34 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-05-22 21:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 12:28 [PATCH bpf-next v2 0/4] bpf: make trusted args nullable Vadim Fedorenko
2024-05-10 12:28 ` [PATCH bpf-next v2 1/4] bpf: verifier: make kfuncs args nullalble Vadim Fedorenko
2024-05-21 19:48   ` Eduard Zingerman
2024-05-10 12:28 ` [PATCH bpf-next v2 2/4] bpf: crypto: make state and IV dynptr nullable Vadim Fedorenko
2024-05-21 19:48   ` Eduard Zingerman
2024-05-10 12:28 ` [PATCH bpf-next v2 3/4] selftests: bpf: crypto: use NULL instead of 0-sized dynptr Vadim Fedorenko
2024-05-21 19:48   ` Eduard Zingerman
2024-05-10 12:28 ` [PATCH bpf-next v2 4/4] selftests: bpf: crypto: adjust bench to use nullable IV Vadim Fedorenko
2024-05-21 19:49   ` Eduard Zingerman
2024-05-22 18:01   ` Martin KaFai Lau
2024-05-22 18:07     ` Eduard Zingerman
2024-05-22 21:18     ` Vadim Fedorenko
2024-05-21 19:46 ` [PATCH bpf-next v2 0/4] bpf: make trusted args nullable Eduard Zingerman
     [not found]   ` <912ac775-1505-468b-9030-88cbbf8e30f2@linux.dev>
     [not found]     ` <836e4a4ca07872fed42c0b2327dddecf47c572c0.camel@gmail.com>
2024-05-22 16:34       ` Vadim Fedorenko
2024-05-22 18:06         ` Martin KaFai Lau

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