Releases: aquasecurity/libbpfgo
v0.4.8-libbpf-1.2.0
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
What's Changed
- fix truncate output by @geyslan in #301
- Add
AttachIterto wrapbpf_program__attach_iterby @mozillazg in #254 - parse bpf helper funcs by @roikol in #302
- chore: call bpf_program__attach_iter from go by @geyslan in #304
- libbpf: bump to b2e29a1 by @geyslan in #306
- Fix typo by @mozillazg in #307
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
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
- Fix/kernel symbol memory by @NDStrahilevitz in #281
- Lazy kernel symbols by @NDStrahilevitz in #282
- lazy ksymbols: fix address search by @NDStrahilevitz in #283
- fix: va_end() va_list copy rather than copied by @geyslan in #286
- fix hardcoded flag values by @NDStrahilevitz in #287
- Upgrade libbpf to 1.1.0 by @mozillazg in #280
- build: add minimum vmlinux.h and uapi headers by @geyslan in #288
- logger callbacks by @geyslan in #284
- logger_cb: remove default callbacks by @geyslan in #294
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
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
Fixes included:
- fix: re-introduce memory bumping (#265)
v0.4.3-libbpf-1.0.1
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
InitGlobalVariableto 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
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
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/helpersis now contained in its own module. You can now upgrade it as a dependency independently of libbpfgo.
You may run into errors when runninggo mod tidythat can be fixed by clearing your go cache or explicitlygo 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
v0.4.0-libbpf-1.0.0
This release of libbpfgo now provides official support for libbpf v1.0.0
Breaking Changes
CompareKernelReleasehelper now has two returns (adding an error, using a typed return) #232- SocketOption Parsing has a few changes to its API. (#203)
- The type
SocketOptionArgumentis now a struct (previous uint64), which affects all related constants ParseSocketOptionhas been removed and replaced byParseSetSocketOptionandParseGetSocketOption
- The type
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
AttachNetnsAPI to wrapbpf_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
This release of libbpfgo now provides official support for statically/dynamically linking libbpf v0.8.0!!!
Breaking Changes
ListProgramNamesAPI was removedGetUnsafePointerhelper was removed
New APIs
BPFMap.SetValueSize()(calls libbpf bpf_map__set_value_size) #156BPFMap.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) #166GetValueFlags()/UpdateValueFlags()#154- The enables passing a
MapFlagargument to the bpf helper functionsbpf_map_update_elemandbpf_map_lookup_elem_flags
- The enables passing a
BPFProg.AttachXDP()(calls libbpf bpf_program__attach_xdp) #170BPFProg.GetSectionName()(calls libbpf bpf_program_-section_name) #164BPFMapTypeIsSupported()/BPFProgramTypeIsSupported()#164SetStrictMode()(calls libbpf_set_strict_mode) #160BPFLink.Pin()/BPFLink.Unpin()(calls libbpf bpf_link__pin/unpin) #144BPFProg.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
setsockoptandgetsockopt#181 CreateMap()(calls bpf_map_create) #138BPFMap.Name()/BPFMap.Type(calls libbpf bpf_map__name/bpf_map__type) #138BPFMap.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