Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: libbpf/libbpf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.2
Choose a base ref
...
head repository: libbpf/libbpf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.3
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Sep 3, 2024

  1. libbpf: Fix bpf_object__open_skeleton()'s mishandling of options

    We do an ugly copying of options in bpf_object__open_skeleton() just to
    be able to set object name from skeleton's recorded name (while still
    allowing user to override it through opts->object_name).
    
    This is not just ugly, but it also is broken due to memcpy() that
    doesn't take into account potential skel_opts' and user-provided opts'
    sizes differences due to backward and forward compatibility. This leads
    to copying over extra bytes and then failing to validate options
    properly. It could, technically, lead also to SIGSEGV, if we are unlucky.
    
    So just get rid of that memory copy completely and instead pass
    default object name into bpf_object_open() directly, simplifying all
    this significantly. The rule now is that obj_name should be non-NULL for
    bpf_object_open() when called with in-memory buffer, so validate that
    explicitly as well.
    
    We adopt bpf_object__open_mem() to this as well and generate default
    name (based on buffer memory address and size) outside of bpf_object_open().
    
    Fixes: d66562fba1ce ("libbpf: Add BPF object skeleton support")
    Reported-by: Daniel Müller <deso@posteo.net>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: Daniel Müller <deso@posteo.net>
    Acked-by: Eduard Zingerman <eddyz87@gmail.com>
    Link: https://lore.kernel.org/bpf/20240827203721.1145494-1-andrii@kernel.org
    (cherry picked from commit f6f2402)
    anakryiko committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    142926a View commit details
    Browse the repository at this point in the history
  2. libbpf: Ensure new BTF objects inherit input endianness

    New split BTF needs to preserve base's endianness. Similarly, when
    creating a distilled BTF, we need to preserve original endianness.
    
    Fix by updating libbpf's btf__distill_base() and btf_new_empty() to retain
    the byte order of any source BTF objects when creating new ones.
    
    Fixes: ba451366bf44 ("libbpf: Implement basic split BTF support")
    Fixes: 58e185a0dc35 ("libbpf: Add btf__distill_base() creating split BTF with distilled base BTF")
    Reported-by: Song Liu <song@kernel.org>
    Reported-by: Eduard Zingerman <eddyz87@gmail.com>
    Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Tested-by: Alan Maguire <alan.maguire@oracle.com>
    Acked-by: Eduard Zingerman <eddyz87@gmail.com>
    Link: https://lore.kernel.org/bpf/6358db36c5f68b07873a0a5be2d062b1af5ea5f8.camel@gmail.com/
    Link: https://lore.kernel.org/bpf/20240830095150.278881-1-tony.ambardar@gmail.com
    (cherry picked from commit fe28fae)
    guidosarducci authored and anakryiko committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    bef446c View commit details
    Browse the repository at this point in the history
  3. libbpf: bump version to v1.2.3

    Bump patch version to prepare for v1.2.3
    
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    anakryiko committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    a3f1d7e View commit details
    Browse the repository at this point in the history
Loading