From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: "Daniel T. Lee" <danieltimlee@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andriin@fb.com>,
Network Development <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next] libbf: fix uninitialized pointer at btf__parse_raw()
Date: Thu, 6 Aug 2020 16:48:04 -0700 [thread overview]
Message-ID: <CAADnVQLohzfYs7RLFt09aG6QqC8HVO2CgzJ08jyoUybJt10bDg@mail.gmail.com> (raw)
In-Reply-To: <5f2ba174c65a7_291f2b27e574e5b81@john-XPS-13-9370.notmuch>
On Wed, Aug 5, 2020 at 11:22 PM John Fastabend <john.fastabend@gmail.com> wrote:
>
> Daniel T. Lee wrote:
> > Recently, from commit 94a1fedd63ed ("libbpf: Add btf__parse_raw() and
> > generic btf__parse() APIs"), new API has been added to libbpf that
> > allows to parse BTF from raw data file (btf__parse_raw()).
> >
> > The commit derives build failure of samples/bpf due to improper access
> > of uninitialized pointer at btf_parse_raw().
> >
> > btf.c: In function btf__parse_raw:
> > btf.c:625:28: error: btf may be used uninitialized in this function
> > 625 | return err ? ERR_PTR(err) : btf;
> > | ~~~~~~~~~~~~~~~~~~~^~~~~
> >
> > This commit fixes the build failure of samples/bpf by adding code of
> > initializing btf pointer as NULL.
> >
> > Fixes: 94a1fedd63ed ("libbpf: Add btf__parse_raw() and generic btf__parse() APIs")
> > Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
> > ---
>
> Unless errno is zero this should be ok in practice, but I guess compiler
> wont know that.
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
Applied. Thanks
prev parent reply other threads:[~2020-08-06 23:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-05 22:33 [PATCH bpf-next] libbf: fix uninitialized pointer at btf__parse_raw() Daniel T. Lee
2020-08-06 6:21 ` John Fastabend
2020-08-06 23:48 ` Alexei Starovoitov [this message]
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=CAADnVQLohzfYs7RLFt09aG6QqC8HVO2CgzJ08jyoUybJt10bDg@mail.gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=danieltimlee@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
/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.