summaryrefslogtreecommitdiff
path: root/kernel/bpf/cpumask.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2023-02-21 23:06:45 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-02-22 23:50:34 +0300
commitdbd8d22863e83ee2834642e4cfd3bdacb8a1c975 (patch)
tree8f8bcab2c6fed6580e386b346c2d727154327947 /kernel/bpf/cpumask.c
parentda03e43a8c500fcfb11ac5eeb03c1b4a9c1dd958 (diff)
downloadlinux-dbd8d22863e83ee2834642e4cfd3bdacb8a1c975.tar.xz
bpf: Wrap register invalidation with a helper
Typically, verifier should use env->allow_ptr_leaks when invaliding registers for users that don't have CAP_PERFMON or CAP_SYS_ADMIN to avoid leaking the pointer value. This is similar in spirit to c67cae551f0d ("bpf: Tighten ptr_to_btf_id checks."). In a lot of the existing checks, we know the capabilities are present, hence we don't do the check. Instead of being inconsistent in the application of the check, wrap the action of invalidating a register into a helper named 'mark_invalid_reg' and use it in a uniform fashion to replace open coded invalidation operations, so that the check is always made regardless of the call site and we don't have to remember whether it needs to be done or not for each case. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20230221200646.2500777-7-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/cpumask.c')
0 files changed, 0 insertions, 0 deletions