BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] bpf: make trusted args nullable
@ 2024-05-09 13:40 Vadim Fedorenko
  2024-05-09 13:40 ` [PATCH bpf-next 1/4] bpf: verifier: make kfuncs args nullalble Vadim Fedorenko
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vadim Fedorenko @ 2024-05-09 13:40 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.

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                              | 10 +++++-----
 kernel/bpf/verifier.c                            |  6 +++---
 tools/testing/selftests/bpf/progs/crypto_bench.c | 10 ++++------
 .../testing/selftests/bpf/progs/crypto_sanity.c  | 16 ++++------------
 4 files changed, 16 insertions(+), 26 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-05-10  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 13:40 [PATCH bpf-next 0/4] bpf: make trusted args nullable Vadim Fedorenko
2024-05-09 13:40 ` [PATCH bpf-next 1/4] bpf: verifier: make kfuncs args nullalble Vadim Fedorenko
2024-05-09 13:40 ` [PATCH bpf-next 2/4] bpf: crypto: make state and IV dynptr nullable Vadim Fedorenko
2024-05-10  3:07   ` kernel test robot
2024-05-09 13:40 ` [PATCH bpf-next 3/4] selftests: bpf: crypto: use NULL instead of 0-sized dynptr Vadim Fedorenko
2024-05-09 13:40 ` [PATCH bpf-next 4/4] selftests: bpf: crypto: adjust bench to use nullable IV Vadim Fedorenko

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