From: Eduard Zingerman <eddyz87@gmail.com>
To: Haojian Zhuang <haojian.zhuang@linaro.org>, bpf@vger.kernel.org
Cc: 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, 04 Mar 2024 14:46:06 +0200 [thread overview]
Message-ID: <07f7315efef78b7a19dec16b59b74b15f7b97dd6.camel@gmail.com> (raw)
In-Reply-To: <20240303023732.1390919-1-haojian.zhuang@linaro.org>
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).
next prev parent reply other threads:[~2024-03-04 12:46 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 [this message]
2024-03-04 13:02 ` Haojian Zhuang
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=07f7315efef78b7a19dec16b59b74b15f7b97dd6.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haojian.zhuang@linaro.org \
--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