bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <ast@kernel.org>, davem@davemloft.net
Cc: dan.carpenter@oracle.com, netdev@vger.kernel.org,
	bpf@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH bpf-next] bpf: fix static checker warning
Date: Wed, 27 Nov 2019 01:07:55 +0100	[thread overview]
Message-ID: <bd0bc378-5ff8-dd80-7b07-6c946f3eaedf@iogearbox.net> (raw)
In-Reply-To: <20191126230106.237179-1-ast@kernel.org>

On 11/27/19 12:01 AM, Alexei Starovoitov wrote:
> kernel/bpf/btf.c:4023 btf_distill_func_proto()
>          error: potentially dereferencing uninitialized 't'.
> 
> kernel/bpf/btf.c
>    4012          nargs = btf_type_vlen(func);
>    4013          if (nargs >= MAX_BPF_FUNC_ARGS) {
>    4014                  bpf_log(log,
>    4015                          "The function %s has %d arguments. Too many.\n",
>    4016                          tname, nargs);
>    4017                  return -EINVAL;
>    4018          }
>    4019          ret = __get_type_size(btf, func->type, &t);
>                                                         ^^
> t isn't initialized for the first -EINVAL return
> 
> This is unlikely path, since BTF should have been validated at this point.
> Fix it by returning 'void' BTF.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Applied, thanks!

      reply	other threads:[~2019-11-27  0:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 23:01 [PATCH bpf-next] bpf: fix static checker warning Alexei Starovoitov
2019-11-27  0:07 ` Daniel Borkmann [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=bd0bc378-5ff8-dd80-7b07-6c946f3eaedf@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.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 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).