From: David Vernet <void@manifault.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: davem@davemloft.net, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@kernel.org, davemarchevsky@meta.com, tj@kernel.org,
memxor@gmail.com, netdev@vger.kernel.org, bpf@vger.kernel.org,
kernel-team@fb.com
Subject: Re: [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto.
Date: Mon, 13 Mar 2023 19:02:41 -0500 [thread overview]
Message-ID: <20230314000241.GA202344@maniforge> (raw)
In-Reply-To: <20230313235845.61029-2-alexei.starovoitov@gmail.com>
On Mon, Mar 13, 2023 at 04:58:43PM -0700, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
>
> bpf_strncmp() doesn't write into its first argument.
> Make sure that the verifier knows about it.
>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: David Vernet <void@manifault.com>
> ---
> kernel/bpf/helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 77d64b6951b9..f753676ef652 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -571,7 +571,7 @@ static const struct bpf_func_proto bpf_strncmp_proto = {
> .func = bpf_strncmp,
> .gpl_only = false,
> .ret_type = RET_INTEGER,
> - .arg1_type = ARG_PTR_TO_MEM,
> + .arg1_type = ARG_PTR_TO_MEM | MEM_RDONLY,
> .arg2_type = ARG_CONST_SIZE,
> .arg3_type = ARG_PTR_TO_CONST_STR,
> };
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-03-14 0:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
2023-03-14 0:02 ` David Vernet [this message]
2023-03-13 23:58 ` [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID Alexei Starovoitov
2023-03-14 0:07 ` David Vernet
2023-03-13 23:58 ` [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id Alexei Starovoitov
2023-03-14 0:15 ` David Vernet
2023-03-14 0:19 ` Alexei Starovoitov
2023-03-14 5:33 ` [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id John Fastabend
2023-03-14 6:40 ` patchwork-bot+netdevbpf
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=20230314000241.GA202344@maniforge \
--to=void@manifault.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=davemarchevsky@meta.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).