]> www.infradead.org Git - users/dwmw2/linux.git/commit
bpf: tidy up exception callback management a bit
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 4 Dec 2023 23:39:21 +0000 (15:39 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 12 Dec 2023 03:23:32 +0000 (19:23 -0800)
commit1a1ad782dcbbacd9e8d4e2e7ff1bf14d1db80727
tree2ef700bf4b474dc18dec4fcb804892f6b0887edd
parent22b769bb4f87060774bfdd6facbab438ed3b8453
bpf: tidy up exception callback management a bit

Use the fact that we are passing subprog index around and have
a corresponding struct bpf_subprog_info in bpf_verifier_env for each
subprogram. We don't need to separately pass around a flag whether
subprog is exception callback or not, each relevant verifier function
can determine this using provided subprog index if we maintain
bpf_subprog_info properly.

Also move out exception callback-specific logic from
btf_prepare_func_args(), keeping it generic. We can enforce all these
restriction right before exception callback verification pass. We add
out parameter, arg_cnt, for now, but this will be unnecessary with
subsequent refactoring and will be removed.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20231204233931.49758-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/verifier.c