From: Eduard Zingerman <eddyz87@gmail.com>
To: 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: Thu, 25 Aug 2022 01:05:31 +0300 [thread overview]
Message-ID: <f040525326088f63201d2ef76a7b759f44f38350.camel@gmail.com> (raw)
In-Reply-To: <63055fa5a080e_292a8208db@john.notmuch>
> 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.
Thanks,
Eduard
next prev parent reply other threads:[~2022-08-24 22:05 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 [this message]
2022-08-25 6:21 ` John Fastabend
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=f040525326088f63201d2ef76a7b759f44f38350.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox