diff options
author | Alexei Starovoitov <ast@kernel.org> | 2023-04-04 07:50:22 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2023-04-05 02:57:03 +0300 |
commit | 7d64c513284408fee5178a0953a686e9410f2399 (patch) | |
tree | f8d95ae0e4083338871112b5312d4310f04c86be /net/ipv4 | |
parent | 8fc59c26d212c23d6fd5ad47a10651cf72d83b4a (diff) | |
download | linux-7d64c513284408fee5178a0953a686e9410f2399.tar.xz |
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
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/bpf_tcp_ca.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index ea21c96c03aa..d6465876bbf6 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -78,9 +78,6 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, const struct btf_type *t; size_t end; - if (atype == BPF_READ) - return btf_struct_access(log, reg, off, size, atype, next_btf_id, flag); - t = btf_type_by_id(reg->btf, reg->btf_id); if (t != tcp_sock_type) { bpf_log(log, "only read is supported\n"); |