From: Yonghong Song <yonghong.song@linux.dev>
To: Jerome Marchand <jmarchan@redhat.com>, bpf@vger.kernel.org
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
linux-kernel@vger.kernel.org,
Eduard Zingerman <eddyz87@gmail.com>
Subject: Re: [PATCH v2 1/2] bpf: Specify access type of bpf_sysctl_get_name args
Date: Tue, 10 Jun 2025 09:41:52 -0700 [thread overview]
Message-ID: <f8ecfb2d-c82f-4785-b5dd-eccec0d13f8a@linux.dev> (raw)
In-Reply-To: <20250610091933.717824-2-jmarchan@redhat.com>
On 6/10/25 2:19 AM, Jerome Marchand wrote:
> The second argument of bpf_sysctl_get_name() helper is a pointer to a
> buffer that is being written to. However that isn't specify in the
> prototype.
>
> Until commit 37cce22dbd51a ("bpf: verifier: Refactor helper access
> type tracking"), all helper accesses were considered as a possible
> write access by the verifier, so no big harm was done. However, since
> then, the verifier might make wrong asssumption about the content of
> that address which might lead it to make faulty optimizations (such as
> removing code that was wrongly labeled dead). This is what happens in
> test_sysctl selftest to the tests related to sysctl_get_name.
>
> Add MEM_WRITE flag the second argument of bpf_sysctl_get_name().
>
> Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2025-06-10 16:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 16:54 [PATCH] bpf: Specify access type of bpf_sysctl_get_name args Jerome Marchand
2025-05-27 19:56 ` Yonghong Song
2025-05-28 9:09 ` Jerome Marchand
2025-05-28 17:41 ` Yonghong Song
2025-05-27 21:39 ` Eduard Zingerman
2025-05-28 12:47 ` Jerome Marchand
2025-05-28 16:41 ` Eduard Zingerman
2025-05-29 11:35 ` Jerome Marchand
2025-06-10 9:19 ` [PATCH v2 0/2] " Jerome Marchand
2025-06-10 9:19 ` [PATCH v2 1/2] " Jerome Marchand
2025-06-10 16:41 ` Yonghong Song [this message]
2025-06-10 9:19 ` [PATCH v2 2/2] selftests/bpf: Convert test_sysctl to prog_tests Jerome Marchand
2025-06-10 17:16 ` Yonghong Song
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=f8ecfb2d-c82f-4785-b5dd-eccec0d13f8a@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jmarchan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.