From: Yafang Shao <laoar.shao@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Quentin Monnet <quentin@isovalent.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Hao Luo <haoluo@google.com>, bpf <bpf@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH bpf-next v2 2/2] bpf: Warn on non-preallocated case for missed trace types
Date: Thu, 7 Jul 2022 18:29:48 +0800 [thread overview]
Message-ID: <CALOAHbDN3zv0Tx+poM5jH_AHR7HzVLag8534QdS07c2U_rVtbQ@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQLHDATCgQE39nVTy-LE+Mhx-hXbj8phBeyUKFc1f=W-6A@mail.gmail.com>
On Thu, Jul 7, 2022 at 12:50 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Wed, Jul 6, 2022 at 8:59 AM Yafang Shao <laoar.shao@gmail.com> wrote:
> >
> > BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE and BPF_PROG_TYPE_TRACING are
> > trace type as well, which may also cause unexpected memory allocation if
> > we set BPF_F_NO_PREALLOC.
> > Let's also warn on both of them.
> >
> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> > ---
> > kernel/bpf/verifier.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index df3ec6b05f05..f9c0f4889a3a 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -12570,6 +12570,8 @@ static bool is_tracing_prog_type(enum bpf_prog_type type)
> > case BPF_PROG_TYPE_TRACEPOINT:
> > case BPF_PROG_TYPE_PERF_EVENT:
> > case BPF_PROG_TYPE_RAW_TRACEPOINT:
> > + case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE:
> > + case BPF_PROG_TYPE_TRACING:
>
> BPF_TRACE_ITER should probably be excluded.
Right, I have verified that BPF_TRACE_ITER can be excluded.
Will change it.
--
Regards
Yafang
next prev parent reply other threads:[~2022-07-07 10:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 15:58 [PATCH bpf-next v2 0/2] bpf: Minor fixes for non-preallocated memory Yafang Shao
2022-07-06 15:58 ` [PATCH bpf-next v2 1/2] bpf: Make non-preallocated allocation low priority Yafang Shao
2022-07-06 16:47 ` Alexei Starovoitov
2022-07-06 19:09 ` Roman Gushchin
2022-07-06 22:11 ` Alexei Starovoitov
2022-07-06 22:54 ` Roman Gushchin
2022-07-06 23:22 ` Alexei Starovoitov
2022-07-07 0:07 ` Shakeel Butt
2022-07-07 0:14 ` Alexei Starovoitov
2022-07-07 0:25 ` Roman Gushchin
2022-07-07 2:09 ` Alexei Starovoitov
2022-07-07 3:36 ` Roman Gushchin
2022-07-07 10:27 ` Yafang Shao
2022-07-07 15:44 ` Alexei Starovoitov
2022-07-07 16:19 ` Yafang Shao
2022-07-06 15:58 ` [PATCH bpf-next v2 2/2] bpf: Warn on non-preallocated case for missed trace types Yafang Shao
2022-07-06 16:50 ` Alexei Starovoitov
2022-07-07 10:29 ` Yafang Shao [this message]
2022-07-07 15:45 ` Alexei Starovoitov
2022-07-07 16:22 ` Yafang Shao
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=CALOAHbDN3zv0Tx+poM5jH_AHR7HzVLag8534QdS07c2U_rVtbQ@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-mm@kvack.org \
--cc=quentin@isovalent.com \
--cc=roman.gushchin@linux.dev \
--cc=songliubraving@fb.com \
--cc=yhs@fb.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