Re: [PATCH] bpf: check mem for dynptr type

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

 



On Sun, 2024-03-03 at 02:37 +0000, Haojian Zhuang wrote:
> When user sends message to bpf prog by a user ring buffer, a callback
> in bpf prog should load data from the user ring buffer.
> 
> By default, check_mem_access() doesn't handle the type of
> CONST_PTR_TO_DYNPTR. So verifier reports an invalid memory access issue.
> 
> So add the case of CONST_PTR_TO_DYNPTR type. Make bpf prog to handle
> content in the user ring buffer.
> 

You are referring to bpf_user_ringbuf_drain() helper function, right?
Could you please provide an example of program that fails to verify?
(ideally the patch set should extend
 tools/testing/selftests/bpf/progs/user_ringbuf_success.c
 to make sure that intended use case is tested).






[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