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 <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20230626212522.2414485-1-sdf@google.com
This commit is contained in:
Stanislav Fomichev 2023-06-26 14:25:21 -07:00 committed by Daniel Borkmann
parent 17e8e5d6e0
commit 819d43428a
1 changed files with 2 additions and 0 deletions

View File

@ -6135,6 +6135,8 @@ static int btf_struct_walk(struct bpf_verifier_log *log, const struct btf *btf,
*flag = 0; *flag = 0;
again: 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); tname = __btf_name_by_offset(btf, t->name_off);
if (!btf_type_is_struct(t)) { if (!btf_type_is_struct(t)) {
bpf_log(log, "Type '%s' is not a struct\n", tname); bpf_log(log, "Type '%s' is not a struct\n", tname);