new(ci): scheduled bpfcompat distro-kernel compatibility matrix for modern_bpf - #3024
Conversation
Add a non-blocking, scheduled workflow that builds bpf_probe.o and load/attach-validates it inside disposable QEMU/KVM VMs running unmodified vendor distro cloud images, producing a per-kernel compatibility matrix (including which program variant each kernel selects) in the job summary plus a JSON/Markdown report artifact. The manifest under test/bpfcompat/ mirrors the libpman loader contract: runtime-sized maps, bpf_loop helper-gated program variants, and trial-probed BPF iterator programs with the prog-array dispatch programs kept autoloaded. Complements drivers_ci/bpfvalidator: load/attach evidence per kernel, not event-capture testing. Proposed in falcosecurity#3023. Signed-off-by: ErenAri <erenari27@gmail.com>
|
Welcome @ErenAri! It looks like this is your first PR to falcosecurity/libs 🎉 |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3024 +/- ##
==========================================
+ Coverage 75.58% 75.74% +0.16%
==========================================
Files 299 299
Lines 33123 33251 +128
Branches 5138 5139 +1
==========================================
+ Hits 25037 25187 +150
+ Misses 8086 8064 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Gentle ping on this 🙂 — it's intentionally non-blocking (a scheduled lane / discussion-starter per @FedeDP in #3023), so no rush at all, but I'd really value a maintainer's eyes when there's a moment. @Andreagit97 — given it's deliberately complementary to bpfvalidator (load + attach + per-kernel program-variant selection, not event capture), your read would be especially helpful, and I'm happy to align the manifest with how libpman evolves. Small update since I opened it: I've also validated the enterprise/backported tier — RHEL 8/9/10 (via the free ABI rebuilds), Oracle UEK 7/8, Amazon Linux 2 incl. the no-BTF 4.14, and openSUSE — 14/14 load+attach, which is the band where "kernel version ≠ feature support" bites hardest. Glad to trim scope, adjust the matrix/schedule/file layout, or walk through it at a community call — whatever's easiest for the maintainers. Thanks! |
|
Friendly ping for review — @ekoops, Andrea Terzolo kindly pointed me your way as the drivers maintainer. Quick recap of this PR: a non-blocking, scheduled CI lane that builds Because it's scheduled and non-blocking it can't break merges. Happy to adjust scope/matrix/file layout, or walk through it on a community call — would value your read whenever you have a moment. |
|
I finally took some time to look into this, here are my 2 cents: First of all thanks for the contribution! I understand the rationale for validating the In any case, we don’t change the loader logic very often in this project, so this approach can still make sense as long as the maintenance cost stays low. |
| ls -la driver/modern_bpf/bpf_probe.o | ||
|
|
||
| - name: Validate across the kernel matrix | ||
| uses: Kernel-Guard/bpfcompat@v0.1.5 |
There was a problem hiding this comment.
i would probably use the SHA instead of the tag, it is safer. Same in all the other actions of this workflow
There was a problem hiding this comment.
I agree, it sometimes pops up as a suggestion in security scanning.
There was a problem hiding this comment.
Thanks, that makes sense. I’ll pin bpfcompat to a commit SHA instead of the version tag, and I’ll check the other actions in this workflow as well.
On the binary flow: yes, I agree with the point. The current .o-based validation is meant to keep the initial integration simple and low-maintenance, but supporting a binary command mode is a good direction since it would also validate the userspace loader path. I’ll add that as an alternative flow so projects can choose between direct artifact validation and full loader-path validation.
|
Thanks @Andreagit97 — both points addressed. Pinning by SHA — done. Validating through a binary — I agree this is the more valuable signal: it exercises the userspace loader path, and there's no separate config to keep in sync with loader changes over time. bpfcompat now supports exactly that — a command/binary mode where, instead of loading the For this PR that maps cleanly onto I'm happy to add that as a second job here (alongside, or in place of, the |
Per review from @Andreagit97 (and seconded by @terror96): pin the actions used in this workflow to full commit SHAs rather than moving tags, so a compromised/retagged upstream can't change what runs. actions/checkout @v4 -> 34e1148 (v4.3.1) Kernel-Guard/bpfcompat @v0.1.5 -> 27ed0ee (v0.1.5) actions/upload-artifact @v4 -> ea165f8 (v4.6.2) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Eren Arı <erenari27@gmail.com>
|
Thanks! if i had to choose one approach i would just use the one with the binary ( |
|
Hey, thank you for your effort. As @Andreagit97 , I strongly prefer the binary-based approach. What's the advantage of |
|
Yes, that’s correct. bpfcompat’s main advantage over a local validator is that it validates the compiled eBPF artifact against real distro/kernel combinations. It boots each target kernel in a VM, runs the load/attach check there, and reports a per-kernel compatibility result. |
…nifest Reviewers (@Andreagit97, @ekoops) both prefer validating through a binary over the .o+manifest flow. Switch the workflow to exactly that: - build scap-open statically (MUSL_OPTIMIZED_BUILD adds -static, so the same binary runs unchanged on every guest — RHEL-family glibc is older than the runner's) with the modern_bpf probe skeleton embedded; - run it inside each matrix kernel VM via bpfcompat command mode (`scap-open --modern_bpf --num_events 10`); the exit code is the per-kernel verdict. scap_open() exercises libpman's full load path — runtime-sized maps, helper-gated program variants, trial-probed iterators, attach — then captures a bounded number of events; - delete test/bpfcompat/modern-bpf-manifest.yaml: there is no longer a config to keep in sync with the loader, the loader is the contract; - bump the bpfcompat action pin to v0.3.0 (command mode ships there), still by full commit SHA. Verified end-to-end locally (QEMU/KVM, this exact static build and command): ubuntu-20.04-5.4 FAIL exit 95 ("libpman: ring buffer map type is not supported (errno: 22)"), almalinux-8-4.18 PASS (RHEL ring-buffer backport, 10 events captured), ubuntu-22.04-5.15 PASS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Eren Arı <erenari27@gmail.com>
|
@ekoops @Andreagit97 — done: the PR is now binary-based, as you both preferred. To @ekoops' question, the concrete difference from bpfvalidator in one real run — this exact static build, executed via the workflow's command on real vendor images (QEMU/KVM):
That AlmaLinux row is the case a version check can't answer: a lower-numbered enterprise kernel passing while a higher-numbered upstream one fails — caught by running the real loader on the real vendor kernel. One portability note baked into the workflow: |
|
LGTM label has been added. DetailsGit tree hash: f09b6aff2696676d9a1a2199b45406747f7a7726 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, ErenAri, leogr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
falcosecurity/libs#3024 merged 2026-07-15: a scheduled lane in falcosecurity/libs builds Falco's real userspace loader (scap-open, statically linked, modern_bpf probe embedded) and validates it per kernel via bpfcompat command mode — the loader's exit code is the per-kernel verdict, no manifest to keep in sync. - README: 'Runs upstream' callout + graduate the Falco proof section from standalone evidence to merged upstream CI - case-study-falco-modern-bpf.md: upstream-adoption section; bump the stale v0.2.0 action pin in the reproduce snippet to v0.3.0 - command-validation.md: real-world example under the GitHub Action section Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
Heads-up before the first scheduled run (Monday 06:00 UTC): I dress-rehearsed the merged workflow on a fork and it needs two extra apt packages on the runner (the SHA-pinned action builds its validator from source, which needs libbpf headers). One-line fix with a fully green rehearsal run linked: #3055 — would be great to get it in before Monday so the lane's first run is green. |
…erence Quotes two on-record review comments from falcosecurity/libs#3024 (Andrea Terzolo and drivers maintainer ekoops both preferring the scap-open binary/loader approach), verbatim and linked, explaining why the upstream lane validates via the real loader. Framed explicitly as public technical preferences, not an endorsement. Signed-off-by: Eren Ari <erenari27@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area automation
Does this PR require a change in the driver versions?
No.
What this PR does / why we need it:
Adds a non-blocking, scheduled (weekly + manually dispatchable) workflow that builds
bpf_probe.ofrom this tree and load/attach-validates it inside disposable QEMU/KVM VMs running unmodified vendor distro cloud images, using bpfcompat (Apache-2.0). The job summary shows a per-kernel pass/fail matrix with structured failure reasons — including which program variant each kernel selects (recvmmsg_x/bpf_loopvsrecvmmsg_old_x, iterator support) — plus a JSON/Markdown report artifact.The manifest in
test/bpfcompat/mirrors the libpman loader contract and stays owned by maintainers here:maps.c/ringbuffer.c)bpf_loophelper-gated program variants (exit_event_progs_table)support_probing.c)Green end-to-end run on a stock
ubuntu-latestrunner, 3m18s including the libs build, image downloads, and 3 VM validations: https://github.com/ErenAri/libs/actions/runs/27374069013Scope: complements drivers_ci / bpfvalidator / kernel-testing — load/attach evidence per kernel, not event-capture testing.
Which issue(s) this PR fixes:
Fixes #3023
Special notes for your reviewer:
workflow_dispatchallows on-demand runs.Does this PR introduce a user-facing change?: