From: Haojian Zhuang <haojian.zhuang@linaro.org>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH] bpf: check mem for dynptr type
Date: Mon, 4 Mar 2024 13:02:04 +0000 [thread overview]
Message-ID: <ZeXGTP3ZIFRPGFCG@hackbox2.linaro.org> (raw)
In-Reply-To: <07f7315efef78b7a19dec16b59b74b15f7b97dd6.camel@gmail.com>
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
next prev parent reply other threads:[~2024-03-04 13:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-03 2:37 [PATCH] bpf: check mem for dynptr type Haojian Zhuang
2024-03-04 12:46 ` Eduard Zingerman
2024-03-04 13:02 ` Haojian Zhuang [this message]
2024-03-04 13:13 ` Eduard Zingerman
2024-03-04 13:46 ` Haojian Zhuang
2024-03-04 17:08 ` Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZeXGTP3ZIFRPGFCG@hackbox2.linaro.org \
--to=haojian.zhuang@linaro.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=john.fastabend@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox