Skip to content

Releases: aquasecurity/libbpfgo

v0.4.8-libbpf-1.2.0

03 May 03:20

Choose a tag to compare

What's Changed

This software release includes several changes and improvements. The most significant change is the bump to version 1.2.0 of the libbpf library. The changes in this release include:

  • The libbpfgo library now calls bpf_object__open_mem directly from Go instead of doing so via a C wrapper, which creates two new helper functions in libbpfgo.h: bpf_object_open_opts_new() and bpf_object_open_opts_free(). This change was made by @geyslan.
  • The logger now passes raw libbpf print output to the consumer, letting them decide how to format it, and the callback log level has been fixed. This logger improvement was made by @geyslan.
  • Several build improvements were made, including fixing the compile_commands.json generation (#316), turning clang into the default compiler (#317), and removing gcc-multilib as a dependency (#321).
  • Various linting chores and updates were made, including using clang-format-12 (#320), adding the revive linter (#320), and including all C and H files in the fmt command (#320).
  • The selftests should be used also as samples (#320), and the selftests no longer depend on UAPI headers (#321).
  • All package dependencies have been updated in the Go module (#323).

Full Changelog: v0.4.7-libbpf-1.1.0-41-gb2e29a1...v0.4.8-libbpf-1.2.0

v0.4.7-libbpf-1.1.0-41-gb2e29a1

24 Mar 13:20
e47755f

Choose a tag to compare

What's Changed

Full Changelog: https://github.com/aquasecurity/libbpfgo/compare/v0.4.6-libbpf-1.1.0..v0.4.7-libbpf-1.1.0-41-gb2e29a1

v0.4.6-libbpf-1.1.0

27 Feb 19:31
fde1f6e

Choose a tag to compare

We are pleased to announce the release of libbpfgo version 0.4.6 with the version of libbpf bumped to 1.1.0 - #280.

This version also includes bug fixes and improvements, including an output behaviour change related to the introduced logger callbacks - #284, #294.

Now, with the use of a minimal vmlinux.h, bpftools is no longer a requirement - #288.

What's Changed

Full Changelog: v0.4.5-libbpf-1.0.1...v0.4.6-libbpf-1.1.0

Users are encouraged to upgrade to this new version for improved stability and performance. As always, feedback and contributions are welcome.

v0.4.5-libbpf-1.0.1

12 Dec 20:54

Choose a tag to compare

Fixes and tests included:

5df6c4f selftest: poc for multiple BPF objects that share a ringbuffer
89f37dd makefile: rename targets in selftests common
55b5ac3 Fix building on ppc64
688787f Fix builds on non-AMD64 architectures
74fa9b2 osinfo: add unit tests for helpers/osinfo.go
d0e93b7 makefile: turn libbpfgo-static into default (#277)
66a9ab6 selftests: fix spinlocks selftest
1161940 libbpf: mitigate libbpf_print_fn issues for tracee
aa91d8b libbpf: fix access violation in libbpf_print_fn.
6950f38 selftests: add spinlock selftest (#155)
6070c0d Add parsing function for mmap flags argument (#267)

v0.4.4-libbpf-1.0.1

25 Oct 14:23
9ba4e04

Choose a tag to compare

Fixes included:

  • fix: re-introduce memory bumping (#265)

v0.4.3-libbpf-1.0.1

18 Oct 16:07
57b6f6d

Choose a tag to compare

This is a very small release in which the main purpose is to (finally) fully separate the helpers module from libbpfgo by removing dependence on libbpfgo within helpers. This also includes an awesome new feature for setting global variables.

What's Changed

  • Redefine BPFProgType constants and remove libbpfgo import by @grantseltzer in #263
  • Add InitGlobalVariable to support setting global variables in bpf code by @mozillazg in #258

Full Changelog: v0.4.2-libbpf-1.0.1...v0.4.3-libbpf-1.0.1

v0.4.2-libbpf-1.0.1

11 Oct 23:41
05f36cd

Choose a tag to compare

This is a patch release updating the libbpf submodule and intended support for libbpf v1.0.1 from the previous release (v0.4.1-libbpf-1.0.0) which used libbpf v1.0.0. There are otherwise no changes.

v0.4.1-libbpf-1.0.0

10 Oct 14:04
76c5ff4

Choose a tag to compare

v0.4.1-libbpf-1.0.0

This release of libbpfgo is meant to used with libbpf v1.0.0

Breaking Changes

  • The package github.com/aquasecurity/libbpfgo/helpers is now contained in its own module. You can now upgrade it as a dependency independently of libbpfgo.
    You may run into errors when running go mod tidy that can be fixed by clearing your go cache or explicitly go geting the latest version of it.
    • Each release will cut new releases of both the helpers and libbpfgo module, but upgrading one does not require you to upgrade the other.

New features

  • Introduced a vagrantfile for running tests in a working VM environment (#237)

Improvements/Fixes

  • The value of errno is now properly saved before calls to printf (#256 - Thanks @mozillazg)
  • CGO code is now in its own header file (#257 - Thanks @mozillazg!)
  • Fixed an issue with how cgo handled bitmap padding optimizations in libbpf (#246)
  • Optimized retrieving kernel symbols from symbol table, now caches by address and name (#241)

Full Changelog

76c5ff4 - remove defunct tests (#259) (grantseltzer)
3c30919 - Move embedded C code to a header file (#257) (Huang Huang)
9eb6002 - Helpers in its own mod followup (#255) (grantseltzer)
b398b6e - Save the value of errno before calling printf in cgo code (#256) (Huang Huang)
7139cb4 - Make helpers package it's own module (#246) (grantseltzer)
a8b06c3 - c: stdarg: move references to commit, add a note (Geyslan Gregório)
245a1a1 - Update libbpfgo.go (Geyslan Gregório)
7c90aa9 - Fix undefined behaviour in variadic argument handling (Francisco Javier Honduvilla Coto)
14c6bc9 - Move logic into C code via cgo (rotscale)
c93e66f - kernel_symbols: cache symbols by addr (Nadav Strahilevitz)
bd31ff0 - builder: vagrant: introduce Vagrantfile (Geyslan Gregório)
33d4c0d - makefile: fix vmlinuxh rule (Geyslan Gregório)
b5b0a6e - helpers: remove debugging leftover (#236) (Rafael David Tinoco)
45a1acd - fix Makefiles typos (#235) (Geyslan Gregório)
0f69086 - Clarify code in comments and var names (grantseltzer)
7d0ebda - Quick fix to logic in helpers (grantseltzer)

v0.4.0-libbpf-1.0.0

01 Sep 13:34

Choose a tag to compare

v0.4.0-libbpf-1.0.0

This release of libbpfgo now provides official support for libbpf v1.0.0

Breaking Changes

  • CompareKernelRelease helper now has two returns (adding an error, using a typed return) #232
  • SocketOption Parsing has a few changes to its API. (#203)
    • The type SocketOptionArgument is now a struct (previous uint64), which affects all related constants
    • ParseSocketOption has been removed and replaced by ParseSetSocketOption and ParseGetSocketOption

Fixes to parsing of getsockopt/setsockopt options argument (#203)

New features

  • Accessor functions like BPFMap.GetFd(), BPFMap.GetName(), BPFMap.GetPinPath(),... are now aliases of functions without 'get' (#230)
  • Support for legacy cgroup attachment (#214)
  • Helpers and constants for parsing bpf program type (#209)
  • Added AttachNetns API to wrap bpf_program__atach_netns (#205 - Thanks @mozillazg!)

Improvements/Fixes

  • libbpfgo will not bump rlimit_memlock anymore, libbpf handles this automatically now
  • New selftests - attaching to cgroups and cgroup-legacy (#204, #214) - Thanks @mozillazg!
  • Makefile target for running unit tests in helpers #212
  • Fixes to parsing of getsockopt/setsockopt options argument (#203) - see breaking changes
  • RWArray helpers are now in their own package (#202)
  • Error handling fixes to Batch functions (#198, #199)

v0.3.0-libbpf-0.8.0

28 Jun 21:11
216bd5b

Choose a tag to compare

This release of libbpfgo now provides official support for statically/dynamically linking libbpf v0.8.0!!!

Breaking Changes

  • ListProgramNames API was removed
  • GetUnsafePointer helper was removed

New APIs

  • BPFMap.SetValueSize() (calls libbpf bpf_map__set_value_size) #156
  • BPFMap.GetValueReadInto() (calls libbpf bpf_map__lookup_elem) #156
    • This enables the use per-cpu arrays, hashmaps, and storage!
  • BPFObjectIterator! #166
    • Allows for iterating over each map and program in a BPF object
    • Uses libbpf bpf_object__next_program and bpf_object__next_map
  • GetSectionName (calls libbpf bpf_program__section_name) #166
  • GetValueFlags()/UpdateValueFlags() #154
    • The enables passing a MapFlag argument to the bpf helper functions bpf_map_update_elem and bpf_map_lookup_elem_flags
  • BPFProg.AttachXDP() (calls libbpf bpf_program__attach_xdp) #170
  • BPFProg.GetSectionName() (calls libbpf bpf_program_-section_name) #164
  • BPFMapTypeIsSupported()/BPFProgramTypeIsSupported() #164
  • SetStrictMode() (calls libbpf_set_strict_mode) #160
  • BPFLink.Pin()/BPFLink.Unpin() (calls libbpf bpf_link__pin/unpin) #144
  • BPFProg.AttachGeneric() (calls libbpf bpf_program__attach) #144
    • Allows for autodetection of bpf program and attach types! This is useful for tracing programs
  • BPFProg.SetAttachTarget()/BPFProg.SetAttachType/BPFProg.SetProgramType #144

New Helpers

  • You can now use a range of new helpers for parsing options passed to socket syscalls such as setsockopt and getsockopt #181
  • CreateMap() (calls bpf_map_create) #138
  • BPFMap.Name()/BPFMap.Type (calls libbpf bpf_map__name/bpf_map__type) #138
  • BPFMap.SetType() (calls libbpf bpf_map__set_type) #138

New Selftests/examples

  • Fentry BPF_PROG_TYPE_TRACING sample #144
  • Fentry set attach target selftest #144
  • New tc selftest
  • New XDP selftest
  • Removed the faulty tcpconnect selftest
  • VersionString selftest

Notable Fixes

  • Kernel symbol helpers will no longer have errant square brackets #153
  • Support for arm64 fixes #158
  • A lot of error handling fixes #163 #157, #152, #146, #142