libbpf: __arg_untrusted in bpf_helpers.h
authorEduard Zingerman <eddyz87@gmail.com>
Fri, 4 Jul 2025 23:03:51 +0000 (16:03 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 7 Jul 2025 15:25:07 +0000 (08:25 -0700)
commitaaa0e57e693083b997f21064689710dfe98b326c
treecf4c509c30702400e2a2762546cdaa23be977fcd
parent182f7df70419f368c4310dc151677d574e53c44a
libbpf: __arg_untrusted in bpf_helpers.h

Make btf_decl_tag("arg:untrusted") available for libbpf users via
macro. Makes the following usage possible:

  void foo(struct bar *p __arg_untrusted) { ... }
  void bar(struct foo *p __arg_trusted) {
    ...
    foo(p->buz->bar); // buz derefrence looses __trusted
    ...
  }

Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20250704230354.1323244-6-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/bpf_helpers.h