NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules, #450 by repository stars
Latest stable
v0.22.0
Last release 3 days ago
19 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Rarely documented
notes for 8 of 36 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
1202 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Nothing published for this version
Please note that this version comes with a few breaking changes for XDP users that may require some intervention based on your use case, so please rea…
Hi, everyone! The Cilium project is proud to announce v0.21.0 of ebpf-go, our first major 2026 feature release. Please note that this version comes with a few breaking changes for XDP users that may require some intervention based on your use case, so please read the following section carefully before upgrading! We've also removed some long-deprecated APIs.
This release saw a change to the ELF parsing logic, specifically to XDP programs. Previously, XDP programs had their ProgramSpec.AttachType set to AttachNone. Prompted by upstream changes in Linux 6.18, XDP programs now come with an AttachXDP attach type. This change ensures compatibility with kernels going forward, as well as better interoperability with libbpf-based tools using shared PROG_ARRAY maps.
tl;dr: Linux 6.18 and later disallows mixing attach types within the same program array.
If your application uses a pinned program array, you may need to manually change the attach type of your XDP programs to AttachNone before they are loaded to ensure they can still be inserted into maps containing pre-upgrade programs.
The same goes for BPF links. If you're updating an XDP link created by an older version of ebpf-go, you need to ensure your XDP program is loaded with the same attach type the link was initially created with, or updating will fail with EINVAL.
For an example of how to deal with this change, here's the the Cilium PR that implemented logic to try both attach types when updating links.
ebpf-for-windows was upgraded from 0.21.0 to v1.0.0-rc1. efW made breaking changes to the names of helper functions, our API has been updated to match:
asm.WindowsFnMemcmp -> asm.WindowsFnMemcmpSasm.WindowsFnMemcpy -> asm.WindowsFnMemcpySasm.WindowsFnMemmove -> asm.WindowsFnMemmoveSMapSpecs and resolving function-pointer members. link.AttachStructOps has been added to allow attaching a StructOpsMap as a link. A sched_ext example can be found here.ProgramSpec and MapSpec, meaning linked objects (produced via bpftool gen object) are now handled correctly.btf.Builder can now deduplicate types while generating a BTF blob. Deduplication can be enabled by passing BuilderOptions to NewBuilder with the Deduplication field set to true.ProgramSpec.Compatible was added — ProgramSpec.Tag is now deprecated. The new ProgramSpec.Compatible method compares a loaded program's tag against both SHA-1 and SHA-256 hashes of the spec, ensuring correct behaviour across kernels — including kernel v6.18+, which switched to SHA-256 for program hashing.ProgramInfo.Name is now sourced from BTF func info when available to provide the full program name if it's longer than 15 bytes.Executable.Symbol to resolve addresses to a symbol and relative offset.HaveBPFLinkKprobeMulti, HaveBPFLinkUprobeMulti, and HaveBPFLinkKprobeSession are now exported from the features package, making it easier to probe for multi-attach support before loading programs.RunOptions.BatchSize option has been added to support batching when running programs.CAP_SYS_ADMIN — Loading programs with weak kfuncs on kernels that don't have the kfunc no longer fails with "operation not permitted" when the caller lacks CAP_SYS_ADMIN. The permission error is now treated as "not found" for weak kfuncs.QueryResult.HaveLinkInfo heuristic — The heuristic has been updated to check for at least one attached program with a non-zero link ID, fixing a false positive introduced by a kernel change that began populating the revision field for cgroup queries.In this release we have removed a number of features which had been deprecated for a while.
CollectionSpec.RewriteMaps - Pass CollectionOptions.MapReplacements when loading the CollectionCollectionSpec.RewriteConstants - Use CollectionSpec.Variables instead.NewLinkFromFD - Use NewFromFD instead.HaveProgType - Use HaveProgramType instead.IsUnreferencedSymbol - Use errors.Is(err, asm.ErrUnreferencedSymbol) instead.Instruction.RewriteMapPtr - Use Instruction.AssociateMap instead. If you cannot provide a Map, wrap an fd in a type implementing FDer.Instruction.Sym - Use Instruction.WithSymbol instead.Instruction.MapPtr - Use Instruction.Map instead.Memory.Size now returns an uint32 instead of an intVariable.Size now returns an uint32 instead of an uint64VariableSpec.MapName has been removed, use VariableSpec.SectionName instead.VariableSpec.Offset is no longer a method, and is now a field.VariableSpec.Size now returns an uint32 instead of a uint64.VariableSpec.Type is no longer a method, and is now a field.KprobeInfo.Address has been changed from a method into a field.KprobeInfo.Missed has been changed from a method into a field.KprobeMultiInfo.AddressCount has been removed, use len(KprobeMultiInfo.Address) instead.KprobeMultiInfo.Flags has been changed from a method into a field.KprobeMultiInfo.Missed has been changed from a method into a field.NetNsInfo.NetnsIno was renamed to NetNsInfo.NetnsInodeNetfilterInfo.Hooknum has been renamed to NetfilterInfo.Hook and changed from an uint32 to a NetfilterInetHookNetfilterInfo.Pf has been renamed to NetfilterInfo.ProtocolFamily and changed from an uint32 to a NetfilterProtocolFamilyTracingInfo.TargetObjId has been renamed to NetfilterInfo.TargetObjectIdWe exported methods and types from the btf package. This allowed us to directly assign BTF func info, line info and CO-RE relocations to instructions from outside of the btf package, making some methods unneeded and thus got removed.
ExtInfos.Assign has been removed, use WithFuncMetadata, Instruction.WithSource, and WithCORERelocationMetadata instead.AssignMetadataToInstructions has been removed, use WithFuncMetadata, Instruction.WithSource, and WithCORERelocationMetadata instead.CORERelocationInfos was renamed to CORERelocationOffsets.NewBuilder now takes an additional BuilderOptions. This can be left nil.ProgramSpec.Tag, and introduce ProgramSpec.Compatible by @dylandreimerink in #1932CAP_SYS_ADMIN by @dylandreimerink in #1950Full Changelog: v0.20.0...v0.21.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
btf: Memory-map vmlinux BTF when possible instead of copying to heap (saves several megabytes)
LoadSplitSpec function for easier use of split-BTF filesDetach() method for explicitly detaching linksmap_extra field in MapSpec (enables bloom filter configuration)ExtraRelocationTargetsccache clang)ErrRestrictedKernel when reading zero addresses due to kernel.kptr_restrictErrRestrictedKernel when program info is restricted by kernel security settingsErrRestrictedKernel during ksym resolution unless ksyms are required*Memory instead of **Memory to fix resource leakThe KernelModuleTypes field in ProgramOptions has been removed. In 99% of cases this field should not be necessary anymore. Module BTF should be merged into the vmlinux BTF, as tools like btfhub do.
For advanced use cases that still require passing additional BTF specs for CO-RE relocations, use the new ExtraRelocationTargets field:
Before:
opts := &ebpf.ProgramOptions{
KernelModuleTypes: map[string]*btf.Spec{
"module1": moduleSpec1,
},
}After:
// Merge module BTF into vmlinux BTF (recommended)
// Or for advanced cases:
opts := &ebpf.ProgramOptions{
ExtraRelocationTargets: []*btf.Spec{
moduleSpec1,
},
}The KernelTypes, ModuleTypes, and LoadedModules fields in btf.Cache have been unexported. These fields were internal implementation details and should not have been accessed directly. Users should continue using btf.NewCache() to create cache instances - no code changes are needed if you weren't directly accessing these fields.
cache := btf.NewCache()
cache.KernelTypes = mySpec // This will no longer compileLoadSplitSpec function by @tdaudi in #1819BPF2GO_CC by @jrife in #1829go tool instead of go run in go:generate statements by @ti-mo in #1875ErrRestrictedKernel when kernel pointers are restricted using sysctls by @dylandreimerink in #1858Full Changelog: v0.19.0...v0.20.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.