bpf: add support for fixed-size memory pointer returns for kfuncs
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Mar 2023 23:50:10 +0000 (15:50 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 4 Mar 2023 19:14:32 +0000 (11:14 -0800)
commitf4b4eee6169bb33c5157ebe07e53d7e4be7631c0
treed251cda307aaca61992ee1915cc255f9c2ee6166
parenta461f5adf17756e99ee0903d1a40961b0342ebb3
bpf: add support for fixed-size memory pointer returns for kfuncs

Support direct fixed-size (and for now, read-only) memory access when
kfunc's return type is a pointer to non-struct type. Calculate type size
and let BPF program access that many bytes directly. This is crucial for
numbers iterator.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230302235015.2044271-13-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c