Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf: don't attempt to load unused subprog as an entry-point BPF program #314

Closed
wants to merge 2 commits into from

Commits on Nov 7, 2020

  1. adding ci files

    kernel-patches-bot committed Nov 7, 2020
    Configuration menu
    Copy the full SHA
    31105d6 View commit details
    Browse the repository at this point in the history
  2. libbpf: don't attempt to load unused subprog as an entry-point BPF pr…

    …ogram
    
    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: 9a94f27 ("tools: libbpf: restore the ability to load programs from .text section")
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    anakryiko authored and kernel-patches-bot committed Nov 7, 2020
    Configuration menu
    Copy the full SHA
    cdd0cf0 View commit details
    Browse the repository at this point in the history