Repository navigation
chore(deps): update module github.com/cilium/ebpf to v0.22.0 [security] (master) - #132
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/master-go-github.com-cilium-ebpf-vulnerability
branch
2 times, most recently
from
October 5, 2026 13:21
5245618 to
e2cbd1e
Compare
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate
Bot
force-pushed
the
renovate/master-go-github.com-cilium-ebpf-vulnerability
branch
from
October 20, 2026 09:45
e2cbd1e to
61c201a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
v0.16.0→v0.22.0v0.7.0→v0.22.0ebpf-go is vulnerable to integer overflow via LoadCollectionSpecFromReader
CVE-2026-10722 / GHSA-xhgw-qwwf-pg32 / GO-2026-6238
More information
Details
A vulnerability has been found in cilium ebpf up to 0.21.0. This affects the function loadRawSpec of the file btf/btf.go of the component LoadCollectionSpec/LoadCollectionSpecFromReader. Such manipulation of the argument offset leads to integer overflow. The attack can only be performed from a local environment. The exploit has been disclosed to the public and may be used. The name of the patch is 533dfc82fd228bfadf42ea7180c39de7d9af47fa. A patch should be applied to remediate this issue.
Severity
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:PReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Integer overflow in BTF parsing in github.com/cilium/ebpf
CVE-2026-10722 / GHSA-xhgw-qwwf-pg32 / GO-2026-6238
More information
Details
Integer overflow in BTF parsing in github.com/cilium/ebpf
Severity
Unknown
References
This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).
Release Notes
cilium/ebpf (github.com/cilium/ebpf)
v0.22.0: : Linux 7.1 compat, BPF tokens and vmlinux BTF caching changesCompare Source
Hi everyone! Today we announce the v0.22.0 release of ebpf-go. We ship Linux 7.1 compatibility, older versions of the library will not work on 7.1 kernels and above, so please upgrade if you are targeting the latest releases of Linux. We also made a breaking change to BTF caching, please read those notes. And of course a few fixes, improvements and minor features.
Kernel 7.1 compatibility
In kernel 7.1 the BTF header was extended to introduce a new feature called BTF layout. This change caused our BTF parser to fail when parsing vmlinux for this kernel. This has been fixed in this latest release, we recommend upgrading to this latest release to avoid breakage on 7.1 and newer kernels.
See #2042 for details. Special thanks to @Capricornus007 for making the bug report that allowed us to fix this in a timely manner.
BPF token support
Some BPF-related actions require the user to have root privileges (
CAP_SYS_ADMIN). One example is loading and attaching programs that can inspect kernel memory. In some environments, you may want to permit a known good process to load such BPF programs, but you don't want to grant itCAP_SYS_ADMINto avoid privilege escalation if that process gets compromised.BPF tokens are a mechanism that allows a privileged process to delegate fine-grained BPF capabilities to an unprivileged process. The process of delegating is complex and typically handled by a container runtime such as LXC or a process manager like systemd. This part of the handshake is currently out of scope of ebpf-go, as the library is not in charge of process creation where this delegation takes place.
However, the consuming side is what's included in this release. ebpf-go will automatically detect when the current process is running in a namespace where a BPF token is provided, and will automatically try to obtain an use it for interacting with the BPF syscall. Unlike libbpf, this currently requires no extra configuration on behalf of the application.
See #1953 for more details.
BTF cache changes
Package
btfused to cache kernel (vmlinux) BTF specs globally. This is a significant time gain when loading multiple Collections in a row. However, doing so comes at a fairly significant memory cost (~20 MiB), so users could flush this cache withbtf.FlushKernelSpec. Unfortunately, the caching behaviour being opt-out means users would typically discover it while investigating memory usage, and would then have to find an appropriate time during execution to call the flush function. This was always a band-aid for something we didn't have a clear solution to.With this update, we've removed the global cache and the
btf.FlushKernelSpecfunction, which may slow down subsequent collection loading on busy systems. To opt back in, users can now maintain their own cache object, obtained frombtf.NewCacheand pass it toNewCollectionWithOptionsviaCollectionOptions.Cache. Typically, you would put this in a global variable in a bpf-related package in your application, or keep it around in function scope if you load multiple collections in a row.See #1988 for more details. Thank you @matthyx for these changes.
New features
Bug fixes and improvements
Miscellaneous changes
go fixin CI, fix nil derefs in reflect usage by @ti-mo in #1998New Contributors
Full Changelog: cilium/ebpf@v0.21.0...v0.22.0
v0.21.0: : Struct Ops, Weak Symbols and BTF deduplicationCompare Source
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.
Breaking changes
XDP Attach Type
This release saw a change to the ELF parsing logic, specifically to XDP programs. Previously, XDP programs had their
ProgramSpec.AttachTypeset toAttachNone. Prompted by upstream changes in Linux 6.18, XDP programs now come with anAttachXDPattach 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
AttachNonebefore 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.
Windows helper function rename
ebpf-for-windows was upgraded from
0.21.0tov1.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.WindowsFnMemmoveSNew Features
MapSpecsand resolving function-pointer members.link.AttachStructOpshas been added to allow attaching aStructOpsMapas a link. A sched_ext example can be found here.ProgramSpecandMapSpec, meaning linked objects (produced viabpftool gen object) are now handled correctly.btf.Buildercan now deduplicate types while generating a BTF blob. Deduplication can be enabled by passingBuilderOptionstoNewBuilderwith theDeduplicationfield set to true.ProgramSpec.Compatiblewas added —ProgramSpec.Tagis now deprecated. The newProgramSpec.Compatiblemethod 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.Nameis now sourced from BTF func info when available to provide the full program name if it's longer than 15 bytes.Executable.Symbolto resolve addresses to a symbol and relative offset.HaveBPFLinkKprobeMulti,HaveBPFLinkUprobeMulti, andHaveBPFLinkKprobeSessionare now exported from the features package, making it easier to probe for multi-attach support before loading programs.RunOptions.BatchSizeoption has been added to support batching when running programs.Bug Fixes
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 lacksCAP_SYS_ADMIN. The permission error is now treated as "not found" for weak kfuncs.QueryResult.HaveLinkInfoheuristic — 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.More breaking changes
Deprecations
In this release we have removed a number of features which had been deprecated for a while.
CollectionSpec.RewriteMaps- PassCollectionOptions.MapReplacementswhen loading the Collectioninstead.
CollectionSpec.RewriteConstants- UseCollectionSpec.Variablesinstead.NewLinkFromFD- UseNewFromFDinstead.HaveProgType- UseHaveProgramTypeinstead.IsUnreferencedSymbol- Useerrors.Is(err, asm.ErrUnreferencedSymbol)instead.Instruction.RewriteMapPtr- UseInstruction.AssociateMapinstead. If you cannot provide a Map, wrap an fd in a type implementingFDer.Instruction.Sym- UseInstruction.WithSymbolinstead.Instruction.MapPtr- UseInstruction.Mapinstead.Breaking changes to Memory, Variable and VariableSpec
Memory.Sizenow returns anuint32instead of anintVariable.Sizenow returns anuint32instead of anuint64VariableSpec.MapNamehas been removed, useVariableSpec.SectionNameinstead.VariableSpec.Offsetis no longer a method, and is now a field.VariableSpec.Sizenow returns anuint32instead of auint64.VariableSpec.Typeis no longer a method, and is now a field.Breaking changes to link info
KprobeInfo.Addresshas been changed from a method into a field.KprobeInfo.Missedhas been changed from a method into a field.KprobeMultiInfo.AddressCounthas been removed, uselen(KprobeMultiInfo.Address)instead.KprobeMultiInfo.Flagshas been changed from a method into a field.KprobeMultiInfo.Missedhas been changed from a method into a field.NetNsInfo.NetnsInowas renamed toNetNsInfo.NetnsInodeNetfilterInfo.Hooknumhas been renamed toNetfilterInfo.Hookand changed from anuint32to aNetfilterInetHookNetfilterInfo.Pfhas been renamed toNetfilterInfo.ProtocolFamilyand changed from anuint32to aNetfilterProtocolFamilyTracingInfo.TargetObjIdhas been renamed toNetfilterInfo.TargetObjectIdBreaking changes to BTF API
We 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.Assignhas been removed, useWithFuncMetadata,Instruction.WithSource, andWithCORERelocationMetadatainstead.AssignMetadataToInstructionshas been removed, useWithFuncMetadata,Instruction.WithSource, andWithCORERelocationMetadatainstead.CORERelocationInfoswas renamed toCORERelocationOffsets.NewBuildernow takes an additionalBuilderOptions. This can be leftnil.What's Changed
ProgramSpec.Tag, and introduceProgramSpec.Compatibleby @dylandreimerink in #1932CAP_SYS_ADMINby @dylandreimerink in #1950New Contributors
Full Changelog: cilium/ebpf@v0.20.0...v0.21.0
v0.20.0Compare Source
Performance Improvements
New Features
LoadSplitSpecfunction for easier use of split-BTF filesDetach()method for explicitly detaching linksmap_extrafield in MapSpec (enables bloom filter configuration)ExtraRelocationTargetsccache clang)ErrRestrictedKernelwhen reading zero addresses due tokernel.kptr_restrictErrRestrictedKernelwhen program info is restricted by kernel security settingsErrRestrictedKernelduring ksym resolution unless ksyms are requiredBugfixes
*Memoryinstead of**Memoryto fix resource leakWindows Support Improvements
Breaking Changes
ProgramOptions.KernelModuleTypes removed
The
KernelModuleTypesfield inProgramOptionshas 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
ExtraRelocationTargetsfield:Before:
After:
btf.Cache fields unexported
The
KernelTypes,ModuleTypes, andLoadedModulesfields inbtf.Cachehave been unexported. These fields were internal implementation details and should not have been accessed directly. Users should continue usingbtf.NewCache()to create cache instances - no code changes are needed if you weren't directly accessing these fields.What's Changed
LoadSplitSpecfunction by @tdaudi in #1819BPF2GO_CCby @jrife in #1829go toolinstead ofgo runingo:generatestatements by @ti-mo in #1875ErrRestrictedKernelwhen kernel pointers are restricted using sysctls by @dylandreimerink in #1858New Contributors
Full Changelog: cilium/ebpf@v0.19.0...v0.20.0
v0.19.0Compare Source
Major Performance Improvements
This release includes significant performance optimizations across multiple areas:
Program.Stats()method allows querying runtime statistics without fetching full ProgramInfoCO-RE Improvements
Build System and Toolchain Updates
Enhanced Map Support
MapSpec.Tagsfield for readingbtf_decl_tagattributes set on mapsBPF_F_NO_PREALLOChints and warnings for map types that require this flagAssembly and Instruction Handling
Memory and Variable Access
VariableandMemorytypesWindows Support Improvements
Bug Fixes
BatchLookupandBatchLookupDelete(#1741)InvalidOpCodeforStoreImmwithDWordsize (#1767)WalkDirharder to misuse and added Windows support (#1652)structs.HostLayoutin GoFormatter (#1686)Compatibility Notes
What's Changed
Configuration
📅 Schedule: (in timezone Asia/Taipei)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.