diff options
author | Stanislav Fomichev <sdf@google.com> | 2023-06-26 14:25:21 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2023-06-30 10:35:59 +0200 |
commit | 819d43428a8661abccf8b9ecad94c7e6f23a0024 (patch) | |
tree | 04eab9f1dee7b6f4134a5b8b71dbfe7e6bb0c6ae | |
parent | 17e8e5d6e09adb4b4f4fb5c89b3ec3fcae2c64a6 (diff) | |
download | lwn-819d43428a8661abccf8b9ecad94c7e6f23a0024.tar.gz lwn-819d43428a8661abccf8b9ecad94c7e6f23a0024.zip |
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
-rw-r--r-- | kernel/bpf/btf.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |