From: John Fastabend <john.fastabend@gmail.com>
To: Eduard Zingerman <eddyz87@gmail.com>,
John Fastabend <john.fastabend@gmail.com>,
bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, kernel-team@fb.com, yhs@fb.com
Subject: Re: [PATCH RFC bpf-next 1/2] bpf: propagate nullness information for reg to reg comparisons
Date: Wed, 24 Aug 2022 23:21:37 -0700 [thread overview]
Message-ID: <630714f155a8_e1c39208a1@john.notmuch> (raw)
In-Reply-To: <f040525326088f63201d2ef76a7b759f44f38350.camel@gmail.com>
Eduard Zingerman wrote:
> > On Tue, 2022-08-23 at 16:15 -0700, John Fastabend wrote:
>
> Hi John,
>
> Thank you for commenting!
>
> > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > > index 2c1f8069f7b7..c48d34625bfd 100644
> > > --- a/kernel/bpf/verifier.c
> > > +++ b/kernel/bpf/verifier.c
> > > @@ -472,6 +472,11 @@ static bool type_may_be_null(u32 type)
> > > return type & PTR_MAYBE_NULL;
> > > }
> > >
> > > +static bool type_is_pointer(enum bpf_reg_type type)
> > > +{
> > > + return type != NOT_INIT && type != SCALAR_VALUE;
> > > +}
> > > +
> >
> > Instead of having another helper is_pointer_value() could work here?
> > Checking if we need NOT_INIT in that helper now.
>
> Do you mean modifying the `__is_pointer_value` by adding a check
> `reg->type != NOT_INIT`?
>
> I tried this out and tests are passing, but __is_pointer_value /
> is_pointer_value are used in a lot of places, seem to be a scary
> change, to be honest.
Agree it looks scary I wanted to play around with it more. I agree
its not the same and off to investigate a few places we use
__is_pointer_value now. Might add a few more tests while I'm at it.
>
> Thanks,
> Eduard
next prev parent reply other threads:[~2022-08-25 6:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 9:43 [PATCH RFC bpf-next 0/2] propagate nullness information for reg to reg comparisons Eduard Zingerman
2022-08-22 9:43 ` [PATCH RFC bpf-next 1/2] bpf: " Eduard Zingerman
2022-08-23 23:15 ` John Fastabend
2022-08-24 22:05 ` Eduard Zingerman
2022-08-25 6:21 ` John Fastabend [this message]
2022-08-25 22:31 ` Eduard Zingerman
2022-08-25 2:55 ` Yonghong Song
2022-08-25 6:19 ` John Fastabend
2022-08-25 2:34 ` Yonghong Song
2022-08-22 9:43 ` [PATCH RFC bpf-next 2/2] selftests/bpf: check nullness propagation " Eduard Zingerman
2022-08-25 2:38 ` 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=630714f155a8_e1c39208a1@john.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@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 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.