Re: [PATCH 1/2] bpf: relax zero fixed offset constraint on trusted pointer arguments

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

 



On Mon, 2024-06-17 at 13:43 +0000, Matt Bobrowski wrote:

[...]

> * For OBJ_RELEASE and KF_RELEASE BPF helpers and kfuncs:
> 
>  * If the expected argument type is of an untyped pointer i.e. void *,
>    then we continue to enforce a zero fixed offset as we need to
>    ensure that the correct referenced pointer is handed off correctly
>    to the relevant deallocation routine
> 
>  * If the expected argument is backed by BTF, then we relax the strict
>    zero fixed offset and allow it only if we successfully type matched
>    between the register and argument. A failed type match between
>    register and argument will result in the legacy strict zero offset
>    semantics
> 
> * For KF_TRUSTED_ARGS BPF kfuncs:
> 
>  * The fixed zero offset constraint has been lifted, such that
>    KF_TRUSTED_ARGS BPF kfuncs can now accept a trusted pointer
>    argument with a non-zero fixed offset providing that register and
>    argument BTF has type matched successfully

[...]

Hi Matt,

I've read this and the next patch once, but need more time to provide
feedback. Two quick notes:
- It seems something is wrong with the way this patch set was sent:
  for some reason it is not organized as a single thread (e.g. on vger).
- I see how OBJ_RELEASE arguments trigger btf_struct_ids_match() in
  check_release_arg_reg_off(), but I don't see how KF_TRUSTED_ARGS
  trigger similar logic.
  Do you have some positive tests that verify newly added functionality?
  
Thanks,
Eduard





[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