On Thu, 3 Jul 2025 at 00:43, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > Allow specifying __arg_untrusted for void */char */int */long * > parameters. Treat such parameters as > PTR_TO_MEM|MEM_RDONLY|PTR_UNTRUSTED of size zero. > Intended usage is as follows: > > int memcmp(char *a __arg_untrusted, char *b __arg_untrusted, size_t n) { > bpf_for(i, 0, n) { > if (a[i] - b[i]) // load at any offset is allowed > return a[i] - b[i]; > } > return 0; > } > > Allocate register id for ARG_PTR_TO_MEM parameters only when > PTR_MAYBE_NULL is set. Register id for PTR_TO_MEM is used only to > propagate non-null status after conditionals. > > Suggested-by: Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> > Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx> > --- Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > [...]