Files
linux-stable-mirror/include/linux
Maxim MikityanskiyandAlexei Starovoitov 508362ac66 bpf: Allow helpers to accept pointers with a fixed size
Before this commit, the BPF verifier required ARG_PTR_TO_MEM arguments
to be followed by ARG_CONST_SIZE holding the size of the memory region.
The helpers had to check that size in runtime.

There are cases where the size expected by a helper is a compile-time
constant. Checking it in runtime is an unnecessary overhead and waste of
BPF registers.

This commit allows helpers to accept pointers to memory without the
corresponding ARG_CONST_SIZE, given that they define the memory region
size in struct bpf_func_proto and use ARG_PTR_TO_FIXED_SIZE_MEM type.

arg_size is unionized with arg_btf_id to reduce the kernel image size,
and it's valid because they are used by different argument types.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20220615134847.3753567-3-maximmi@nvidia.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2022-06-16 21:20:29 -07:00
..
2022-05-22 20:44:29 +01:00
2022-05-20 15:29:00 -07:00
2022-06-07 10:20:42 -07:00
2022-05-16 13:37:59 -07:00
2022-06-16 19:27:29 -07:00
2022-05-13 07:20:18 -07:00
2022-05-02 14:06:20 -06:00
2022-05-03 16:09:03 -04:00
2022-05-19 14:08:53 -07:00
2022-05-13 07:20:17 -07:00
2022-05-12 10:29:41 -07:00
2022-05-17 13:32:46 -04:00
2022-05-22 21:03:01 +01:00
2022-06-02 10:15:05 -07:00
2022-05-08 01:33:08 -07:00
2022-05-24 08:41:18 -06:00