Re: [PATCH v2 bpf-next 0/7] Trusted PTR_TO_BTF_ID arg support in global subprogs

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

 



On Thu, 2024-01-25 at 12:55 -0800, Andrii Nakryiko wrote:
> This patch set follows recent changes that added btf_decl_tag-based argument
> annotation support for global subprogs. This time we add ability to pass
> PTR_TO_BTF_ID (BTF-aware kernel pointers) arguments into global subprograms.
> We support explicitly trusted arguments only, for now.
> 
> First three patches are preparatory. Patches #1 and #3 does post-BPF token
> code adjustments, to undo merge conflict avoidance measures. Patch #2 makes
> PERF_EVENT type enforcement logic aligned with kernel-side logic.
> 
> Patch #4 adds logic for arg:trusted tag support on the verifier side. Default
> semantic of such arguments is non-NULL, enforced on caller side. But patch #5
> adds arg:maybe_null tag that can be combined with arg:trusted to make callee
> explicitly do the NULL check, which helps implement "optional" PTR_TO_BTF_ID
> arguments.
> 
> Patch #6 adds libbpf-side __arg_trusted and __arg_maybe_null macros. Patch #7
> adds a bunch of tests validating __arg_trusted in combination with
> __arg_maybe_null.
> 
> v1->v2:
>   - added fix up to type enforcement changes, landed earlier;
>   - dropped bpf_core_cast() changes, will post them separately, as they now
>     are not used in added tests;
>   - dropped arg:untrusted support (Alexei);
>   - renamed arg:nullable to arg:maybe_null (Alexei);
>   - and also added task_struct___local flavor tests (Alexei).

Full patch-set looks good to me.

Acked-by: Eduard Zingerman <eddyz87@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