From: Stanislav Fomichev Date: Mon, 26 Jun 2023 21:25:21 +0000 (-0700) Subject: bpf: Resolve modifiers when walking structs X-Git-Tag: block-6.6-2023-09-08~22^2~405^2~30 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=819d43428a8661abccf8b9ecad94c7e6f23a0024;p=linux-2.6-block.git bpf: Resolve modifiers when walking structs It is impossible to use skb_frag_t in the tracing program. Resolve typedefs when walking structs. Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20230626212522.2414485-1-sdf@google.com --- diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 29fe21099298..3dd47451f097 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6135,6 +6135,8 @@ static int btf_struct_walk(struct bpf_verifier_log *log, const struct btf *btf, *flag = 0; again: + if (btf_type_is_modifier(t)) + t = btf_type_skip_modifiers(btf, t->type, NULL); tname = __btf_name_by_offset(btf, t->name_off); if (!btf_type_is_struct(t)) { bpf_log(log, "Type '%s' is not a struct\n", tname);