From: Paul Chaignon <paul.chaignon@orange.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
Xiao Han <xiao.han@orange.com>,
paul.chaignon@gmail.com, Martin KaFai Lau <kafai@fb.com>,
Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>
Subject: Re: [PATCH bpf] bpf: report verifier bugs as warnings
Date: Wed, 3 Apr 2019 16:40:55 +0200 [thread overview]
Message-ID: <20190403144054.GA25718@Nover> (raw)
In-Reply-To: <20190402173927.pvqprcbjk42km3mc@ast-mbp.dhcp.thefacebook.com>
On Tue, Apr 02, 2019 at 10:39:29AM -0700, Alexei Starovoitov wrote:
> On Tue, Apr 02, 2019 at 04:37:19PM +0200, Daniel Borkmann wrote:
> > On 04/02/2019 01:58 PM, Paul Chaignon wrote:
> > > Three checks for verifier bugs were introduced in commit f4d7e40 ("bpf:
> > > introduce function calls (verification)"). The bugs were reported as
> > > incorrect programs instead of kernel warnings as the present patch
> > > implements.
> > >
> > > Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
> >
> > Thanks for the patch, I think these WARN_ONCE() are a bit out of context though,
> > meaning it lacks additional information about the program in kernel log once we
> > actually manage to trigger it which we'd otherwise would potentially have had with
> > the verbose() log. And from a program debugging pov, it makes it harder after this
> > patch when verification log would suggest that all is fine. Looks like we already
> > have a few WARN_ONCE() in verifier, they should probably be converted to verbose()
> > as well to be consistent. If we really want to have a kernel warn, then lets add a
> > helper macro verbose_and_warn(...) which will trigger a one-time warning, but keeps
> > the verbose log intact as well.
>
> I think they should stay as verbose() messages and some of the WARN_ON
> should be converted to verbose().
> I don't think there is a need for verbose_and_warn().
>
Agreed for the verbose messages; it makes sense. I'm a bit surprised you
don't think the verifier should warn on verifier bugs though. It already
warns for other internal bugs such as 'regno >= MAX_BPF_REG'. Or should
these be converted to verbose() as well?
next prev parent reply other threads:[~2019-04-03 14:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 11:58 [PATCH bpf] bpf: report verifier bugs as warnings Paul Chaignon
2019-04-02 14:37 ` Daniel Borkmann
2019-04-02 17:39 ` Alexei Starovoitov
2019-04-03 14:40 ` Paul Chaignon [this message]
2019-04-03 15:52 ` Edward Cree
2019-04-03 17:30 ` Alexei Starovoitov
2019-04-03 20:24 ` Edward Cree
2019-04-03 22:41 ` Daniel Borkmann
2019-04-04 17:45 ` Alexei Starovoitov
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=20190403144054.GA25718@Nover \
--to=paul.chaignon@orange.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
--cc=paul.chaignon@gmail.com \
--cc=songliubraving@fb.com \
--cc=xiao.han@orange.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;
as well as URLs for NNTP newsgroup(s).