From: John Fastabend <john.fastabend@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
daniel@iogearbox.net
Cc: andrii@kernel.org, kernel-team@fb.com,
Dmitrii Banshchikov <dbanschikov@fb.com>
Subject: RE: [PATCH bpf] libbpf: don't attempt to load unused subprog as an entry-point BPF program
Date: Mon, 09 Nov 2020 13:19:00 -0800 [thread overview]
Message-ID: <5fa9b2442542d_8c0e2085b@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20201107000251.256821-1-andrii@kernel.org>
Andrii Nakryiko wrote:
> If BPF code contains unused BPF subprogram and there are no other subprogram
> calls (which can realistically happen in real-world applications given
> sufficiently smart Clang code optimizations), libbpf will erroneously assume
> that subprograms are entry-point programs and will attempt to load them with
> UNSPEC program type.
>
> Fix by not relying on subcall instructions and rather detect it based on the
> structure of BPF object's sections.
>
> Reported-by: Dmitrii Banshchikov <dbanschikov@fb.com>
> Fixes: 9a94f277c4fb ("tools: libbpf: restore the ability to load programs from .text section")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> ---
Acked-by: John Fastabend <john.fastabend@gmail.com>
prev parent reply other threads:[~2020-11-09 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 0:02 [PATCH bpf] libbpf: don't attempt to load unused subprog as an entry-point BPF program Andrii Nakryiko
2020-11-09 6:13 ` Yonghong Song
2020-11-09 21:19 ` John Fastabend [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=5fa9b2442542d_8c0e2085b@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dbanschikov@fb.com \
--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).