[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2k3v5ywz5hgwc2istobhath7i76azg5yqvbgfgzfvqvyd72zv5@4g3synjlqha4>
Date: Tue, 23 Jul 2024 14:36:18 +0800
From: Shung-Hsi Yu <shung-hsi.yu@...e.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Eduard Zingerman <eddyz87@...il.com>,
Xu Kuohai <xukuohai@...weicloud.com>, bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>, LSM List <linux-security-module@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Yonghong Song <yonghong.song@...ux.dev>,
KP Singh <kpsingh@...nel.org>, Roberto Sassu <roberto.sassu@...wei.com>,
Matt Bobrowski <mattbobrowski@...gle.com>, Yafang Shao <laoar.shao@...il.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>, "Jose E . Marchesi" <jose.marchesi@...cle.com>,
James Morris <jamorris@...ux.microsoft.com>, Kees Cook <kees@...nel.org>,
Brendan Jackman <jackmanb@...gle.com>, Florent Revest <revest@...gle.com>
Subject: Re: [PATCH bpf-next v2 5/9] bpf, verifier: improve signed ranges
inference for BPF_AND
On Mon, Jul 22, 2024 at 05:48:22PM GMT, Alexei Starovoitov wrote:
> On Mon, Jul 22, 2024 at 11:48 AM Eduard Zingerman <eddyz87@...il.com> wrote:
> > On Mon, 2024-07-22 at 20:57 +0800, Shung-Hsi Yu wrote:
> >
> > [...]
> >
> > > > As a nitpick, I think that it would be good to have some shortened
> > > > version of the derivation in the comments alongside the code.
> > >
> > > Agree it would. Will try to add a 2-4 sentence explanation.
> > >
> > > > (Maybe with a link to the mailing list).
> > >
> > > Adding a link to the mailing list seems out of the usual for comment in
> > > verifier.c though, and it would be quite long. That said, it would be
> > > nice to hint that there exists a more verbose version of the
> > > explanation.
> > >
> > > Maybe an explicit "see commit for the full detail" at the end of
> > > the added comment?
> >
> > Tbh, I find bounds deduction code extremely confusing.
> > Imho, having lengthy comments there is a good thing.
>
> +1
> Pls document the logic in the code.
> commit log is good, but good chunk of it probably should be copied
> as a comment.
>
> I've applied the rest of the patches and removed 'test 3' selftest.
> Pls respin this patch and a test.
> More than one test would be nice too.
Ack. Will send send another series that:
1. update current patch
- add code comment explanation how signed ranges are deduced in
scalar*_min_max_and()
- revert 229d6db14942 "selftests/bpf: Workaround strict bpf_lsm return
value check."
2. reintroduce Xu Kuohai's "test 3" into verifier_lsm.c
3. add a few tests for BPF_AND's signed range deduction
- should it be added to verifier_bounds*.c or verifier_and.c?
I think former, because if we later add signed range deduction for
BPF_OR as well, then test for signed range deducation of both
BPF_AND and BPF_OR can live in the same file, which would be nice
as signed range deduction of the two are somewhat symmetric
Powered by blists - more mailing lists