bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] bpf: Resolve modifiers when walking structs
@ 2023-06-26 21:25 Stanislav Fomichev
  2023-06-26 21:25 ` [PATCH bpf-next 2/2] selftests/bpf: Add test to exercise typedef walking Stanislav Fomichev
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stanislav Fomichev @ 2023-06-26 21:25 UTC (permalink / raw)
  To: bpf
  Cc: ast, daniel, andrii, martin.lau, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa

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>
---
 kernel/bpf/btf.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.41.0.162.gfafddb0af9-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-30  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-26 21:25 [PATCH bpf-next 1/2] bpf: Resolve modifiers when walking structs Stanislav Fomichev
2023-06-26 21:25 ` [PATCH bpf-next 2/2] selftests/bpf: Add test to exercise typedef walking Stanislav Fomichev
2023-06-27  5:06   ` Yonghong Song
2023-06-27  5:02 ` [PATCH bpf-next 1/2] bpf: Resolve modifiers when walking structs Yonghong Song
2023-06-30  8:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).