Re: [PATCH bpf-next 1/8] bpf: Invoke btf_struct_access() callback only for writes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 3, 2023 at 9:50 PM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> From: Alexei Starovoitov <ast@xxxxxxxxxx>
>
> Remove duplicated if (atype == BPF_READ) btf_struct_access() from
> btf_struct_access() callback and invoke it only for writes.

It would be nice to elaborate a bit why this is ok. As far as I can
tell, it's because custom btf_struct_access() callbacks are only
checking and overriding write accesses, delegating reads to generic
btf_struct_access(). Is that right? If so, can you please note it down
in the commit message?

Further, given btf_struct_access *callbacks* are now write-only, while
we still keep generic btf_struct_access for reads, should we
distinguish callback's write-only nature by renaming it to something
like "btf_struct_write_access"?

>
> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> ---
>  kernel/bpf/verifier.c          | 2 +-
>  net/bpf/bpf_dummy_struct_ops.c | 2 +-
>  net/core/filter.c              | 6 ------
>  net/ipv4/bpf_tcp_ca.c          | 3 ---
>  4 files changed, 2 insertions(+), 11 deletions(-)
>

[...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux