bpf: Invoke btf_struct_access() callback only for writes.
authorAlexei Starovoitov <ast@kernel.org>
Tue, 4 Apr 2023 04:50:22 +0000 (21:50 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 4 Apr 2023 23:57:03 +0000 (16:57 -0700)
commit7d64c513284408fee5178a0953a686e9410f2399
treef8d95ae0e4083338871112b5312d4310f04c86be
parent8fc59c26d212c23d6fd5ad47a10651cf72d83b4a
bpf: Invoke btf_struct_access() callback only for writes.

Remove duplicated if (atype == BPF_READ) btf_struct_access() from
btf_struct_access() callback and invoke it only for writes. This is
possible to do because currently btf_struct_access() custom callback
always delegates to generic btf_struct_access() helper for BPF_READ
accesses.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/bpf/20230404045029.82870-2-alexei.starovoitov@gmail.com
kernel/bpf/verifier.c
net/bpf/bpf_dummy_struct_ops.c
net/core/filter.c
net/ipv4/bpf_tcp_ca.c