OSDN Git Service

bpf: factor out fetching basic kfunc metadata
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 8 Mar 2023 18:41:14 +0000 (10:41 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 9 Mar 2023 00:19:50 +0000 (16:19 -0800)
commit07236eab7a3139da97aef9f5f21f403be82a82ea
tree2415c090bd26760344d2afce0eeaee57534ccf50
parented69e0667db5fd0f7eb1fdef329e0985939b0148
bpf: factor out fetching basic kfunc metadata

Factor out logic to fetch basic kfunc metadata based on struct bpf_insn.
This is not exactly short or trivial code to just copy/paste and this
information is sometimes necessary in other parts of the verifier logic.
Subsequent patches will rely on this to determine if an instruction is
a kfunc call to iterator next method.

No functional changes intended, including that verbose() warning
behavior when kfunc is not allowed for a particular program type.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230308184121.1165081-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c