bpfcompat is an open-source compatibility validator for compiled eBPF
artifacts. It runs real libbpf load/attach checks against Linux kernel profiles
and produces JSON/Markdown reports that can fail CI when an artifact regresses.
The core question is simple:
Will this
.bpf.oload and attach on the kernels I care about, and if not, what failed?
The project is a serious MVP for compatibility evidence and CI gating. It is not a production runtime loader and it is not a production multi-tenant SaaS.
Implemented:
- VM-backed
.bpf.ovalidation through QEMU/KVM cloud images. - C/libbpf validator that records load, attach, BTF, CO-RE, map, program, and capability evidence.
- Failure classification for common compatibility cases such as missing BTF, CO-RE relocation failures, unsupported map types, unsupported attach types, and unsupported program types.
- Multi-artifact suite support for collections of BPF objects/programs.
- JSON, Markdown, GitHub Action summary, and static compatibility-site output.
- Experimental
virtme-ngupstream-kernel lane. - Experimental Firecracker generated-initramfs backend.
- Experimental runtime probe/select/fetch/agent flow for verified artifact decisioning.
Keep the runtime track framed as decisioning/proof unless you are running it in a controlled environment. Host loading stays disabled/gated by default.
Generated runtime outputs are intentionally not committed:
.bpfcompat/reports/evidence/vm/cache/- generated
.bpf.ofiles
Recreate proof artifacts locally with the commands below.
If this repository is being prepared for public release, read
docs/public-release-checklist.md before
changing GitHub visibility. Deleting private/generated files in a later commit
does not remove them from git history.
For the main QEMU/KVM path:
- Linux host with
/dev/kvm - Go 1.22+
makeclangqemu-system-x86_64qemu-imgsshscpjqpkg-config- development packages for
libbpf,libelf, andzlib
Optional lanes:
- ARM64 VM execution requires an ARM64/aarch64 KVM host,
qemu-system-aarch64, an ARM64 cloud image, and an ARM64 validator binary. - Upstream-kernel execution requires
virtme-ng(vng) andcurl. - Firecracker execution requires a Firecracker binary,
/dev/kvm,busybox,cpio,gzip, and an uncompressed guest kernel.
make doctor
make deps
make build
make validator
make examplesRestricted-network option:
make vendor
make test-vendorValidator modes:
make validatoruses dynamic libbpf linking for local development.make validator-staticbuilds the guest-side validator used by VM profiles.
Download the Ubuntu 22.04 dev image and run one profile:
make vm-ubuntu-22
make acceptance-dev-oneEquivalent direct command:
./bin/bpfcompat test \
--artifact examples/simple-pass/simple_pass.bpf.o \
--manifest examples/simple-pass/manifest-dev-one.yaml \
--matrix matrices/dev-one.yaml \
--out reports/dev-one.json \
--markdown reports/dev-one.md \
--timeout 8mThis stages the artifact, boots a disposable VM overlay, runs the C/libbpf validator inside the guest, copies back target logs, and writes aggregate reports.
Fast local checks:
make acceptance-dev-one
make acceptance-functional-dev-one
make acceptance-suite-dev-oneFull MVP matrix:
make vm-images
make acceptanceExpanded runnable matrix:
make vm-images-expanded-2026
make matrix-runnable
make acceptance-expanded-runnableReal OSS artifact examples:
make oss-examples
make oss-evidencemake oss-evidence writes generated outputs under evidence/oss-validation/.
QEMU/KVM distro profiles:
make acceptance-dev-oneUpstream-mainline smoke through virtme-ng:
make doctor-virtme
make upstream-kernel-runnable
make acceptance-upstream-kernelFirecracker generated-initramfs proof:
make firecracker-preflight
make acceptance-firecracker-dev-oneARM64 smoke:
make doctor-arm64-kvm
make acceptance-arm64-smokeThe ARM64 workflow is wired, but real ARM64 VM compatibility proof requires a native ARM64 KVM runner.
This repository includes a composite action that runs bpfcompat and appends
the Markdown report to the GitHub Actions job summary. VM-backed validation
requires a self-hosted Linux runner with KVM access (/dev/kvm).
Single artifact:
- uses: Kernel-Guard/bpfcompat@v0.1.3
with:
artifact: path/to/program.bpf.o
manifest: path/to/manifest.yaml
matrix: path/to/matrix.yaml
out: reports/bpfcompat.json
markdown: reports/bpfcompat.md
validation-mode: load_attach
timeout: 8mSuite mode:
- uses: Kernel-Guard/bpfcompat@v0.1.3
with:
suite: suites/project.yaml
suite-out: reports/suite.json
suite-markdown: reports/suite.mdSuite cases can opt into validation_mode: load_only, load_attach, or
behavior. Behavior mode runs manifest or suite smoke commands while BPF links
are alive and adds the result to the suite-level collection matrix.
Marketplace quick start:
- Add a self-hosted Linux runner with KVM enabled.
- Commit compiled
.bpf.oartifacts, manifests, and a matrix YAML. - Use the action in CI to produce JSON, Markdown, and job-summary evidence.
- Treat exit code
2as a compatibility gate failure.
The embedded UI is useful for demos and local inspection:
make serveOpen:
http://127.0.0.1:8080/http://127.0.0.1:8080/results
The API has /api/v1/... routes with legacy /api/... compatibility. For
route details, see:
Public demo mode can allow anonymous validation/read/runtime-select/fetch
without enabling host execution. Runtime execute remains separately gated by
BPFCOMPAT_API_ENABLE_RUNTIME_EXECUTE and an approval token.
The runtime path is experimental and should be treated as a controlled proof:
make runtime-selector-proof
make runtime-delivery-proofThe safer product boundary is:
- validate artifact variants in CI/VMs;
- store signed compatibility metadata;
- probe a target host;
- select and fetch the best verified artifact;
- leave host loading to an explicitly approved local agent path.
Relevant docs:
docs/runtime-selector-simulation.mddocs/production-runtime-agent-alpha.mddocs/runtime-execute-policy.mddocs/security-model.mddocs/threat-model.md
docs/architecture.mddocs/acceptance-tests.mddocs/project-compatibility-suite.mddocs/falco-parity.mddocs/backend-execution-proof.mddocs/upstream-kernel-virtme-ng.mddocs/firecracker-backend.mddocs/profile-catalog.mddocs/validator.mddocs/external-ci-proof.md
make test
make openapi-check
make env-docs-check
go vet ./...
golangci-lint run --timeout=5m
govulncheck ./...See CONTRIBUTING.md for route, env, test, and changelog
expectations.
Report security issues through SECURITY.md, not public issues.
Operator guidance:
- keep runtime execute disabled on public demos;
- require write auth or explicit anonymous-demo flags for POST paths;
- do not enable internal-host or
file://fetches outside controlled tests; - run host-loading flows only through a local policy-gated agent path.
Apache-2.0. See LICENSE.