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

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

 



On Mon, Mar 04, 2024 at 02:46:06PM +0200, Eduard Zingerman wrote:
> 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).
> 

Yes, I'm referring to bpf_user_ringbuf_drain() helper function.

Yes, I should extend bpf/progs/user_ringbuf_success.c. And it could be
loaded by bpf/prog_tests/user_ringbuf.c.

But I failed to find the binary of user_ringbuf.c after bpf test cases
built. And there're no binaries for the test cases in bpf/prog_tests
directory. How to make use of these test cases? I failed to find
documents on it. Could you help to share any tips to me? Thanks

Best Regards
Haojian




[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