diff options
author | Daniel Xu <dxu@dxuuu.xyz> | 2022-09-07 19:40:36 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-11 03:27:32 +0300 |
commit | 65269888c695cf4643c6fdb989ea28bf1623685d (patch) | |
tree | 4b60ccc1e4efe4291b558defe3e6c69e7c545507 /include | |
parent | 57c92f11a215717bf90880828b7a23c736c3c0d9 (diff) | |
download | linux-65269888c695cf4643c6fdb989ea28bf1623685d.tar.xz |
bpf: Remove duplicate PTR_TO_BTF_ID RO check
Since commit 27ae7997a661 ("bpf: Introduce BPF_PROG_TYPE_STRUCT_OPS")
there has existed bpf_verifier_ops:btf_struct_access. When
btf_struct_access is _unset_ for a prog type, the verifier runs the
default implementation, which is to enforce read only:
if (env->ops->btf_struct_access) {
[...]
} else {
if (atype != BPF_READ) {
verbose(env, "only read is supported\n");
return -EACCES;
}
[...]
}
When btf_struct_access is _set_, the expectation is that
btf_struct_access has full control over accesses, including if writes
are allowed.
Rather than carve out an exception for each prog type that may write to
BTF ptrs, delete the redundant check and give full control to
btf_struct_access.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/962da2bff1238746589e332ff1aecc49403cd7ce.1662568410.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions