[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231113031812.3639430-1-xwlpt@126.com>
Date: Mon, 13 Nov 2023 03:18:12 +0000
From: Wenli Xie <xwlpt@....com>
To: martin.lau@...ux.dev, ast@...nel.org, daniel@...earbox.net,
song@...nel.org
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
Wenli Xie <wlxie7296@...il.com>
Subject: [PATCH] bpf: Get the program type by resolve_prog_type() directly
From: Wenli Xie <wlxie7296@...il.com>
The bpf program type can be get by resolve_prog_type() directly.
Signed-off-by: Wenli Xie <wlxie7296@...il.com>
---
kernel/bpf/btf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 15d71d2986d3..b8ac96906bc5 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6963,7 +6963,7 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog,
{
struct bpf_verifier_log *log = &env->log;
struct bpf_prog *prog = env->prog;
- enum bpf_prog_type prog_type = prog->type;
+ enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
struct btf *btf = prog->aux->btf;
const struct btf_param *args;
const struct btf_type *t, *ref_t;
@@ -7001,8 +7001,6 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog,
bpf_log(log, "Verifier bug in function %s()\n", tname);
return -EFAULT;
}
- if (prog_type == BPF_PROG_TYPE_EXT)
- prog_type = prog->aux->dst_prog->type;
t = btf_type_by_id(btf, t->type);
if (!t || !btf_type_is_func_proto(t)) {
--
2.34.1
Powered by blists - more mailing lists