From: Dan Carpenter <dan.carpenter@oracle.com>
To: ast@kernel.org
Cc: bpf@vger.kernel.org
Subject: [bug report] bpf: Introduce BPF trampoline
Date: Tue, 26 Nov 2019 15:19:57 +0300 [thread overview]
Message-ID: <20191126121957.6gda4xqy3pacuny3@kili.mountain> (raw)
Hello Alexei Starovoitov,
The patch fec56f5890d9: "bpf: Introduce BPF trampoline" from Nov 14,
2019, leads to the following static checker warning:
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
4020 if (ret < 0) {
4021 bpf_log(log,
4022 "The function %s return type %s is unsupported.\n",
4023 tname, btf_kind_str[BTF_INFO_KIND(t->info)]);
^^^^^^^
4024 return -EINVAL;
4025 }
4026 m->ret_size = ret;
See also:
kernel/bpf/btf.c:4033 btf_distill_func_proto() error: potentially dereferencing uninitialized 't'.
regards,
dan carpenter
reply other threads:[~2019-11-26 12:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20191126121957.6gda4xqy3pacuny3@kili.mountain \
--to=dan.carpenter@oracle.com \
--cc=ast@kernel.org \
--cc=bpf@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).