lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzY8nbE70EqKXn4A9p8b_oCW1UaaifOu6xAyqbN-usLYYA@mail.gmail.com>
Date:   Tue, 4 Apr 2023 16:29:41 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     davem@...emloft.net, daniel@...earbox.net, andrii@...nel.org,
        martin.lau@...nel.org, void@...ifault.com, davemarchevsky@...a.com,
        tj@...nel.org, memxor@...il.com, netdev@...r.kernel.org,
        bpf@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH bpf-next 1/8] bpf: Invoke btf_struct_access() callback
 only for writes.

On Mon, Apr 3, 2023 at 9:50 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> From: Alexei Starovoitov <ast@...nel.org>
>
> 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@...nel.org>
> ---
>  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(-)
>

[...]

Powered by blists - more mailing lists