Re: [PATCH bpf-next v1 7/8] bpf: support for void/primitive __arg_untrusted global func params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>

> [...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux