Skip to content

fix(userspace/libpman): fix bpf helper probe error handling#2720

Merged
poiana merged 1 commit intofalcosecurity:masterfrom
ekoops:ekoops/fix-bpf-helper-probe-handling
Nov 20, 2025
Merged

fix(userspace/libpman): fix bpf helper probe error handling#2720
poiana merged 1 commit intofalcosecurity:masterfrom
ekoops:ekoops/fix-bpf-helper-probe-handling

Conversation

@ekoops
Copy link
Copy Markdown
Contributor

@ekoops ekoops commented Nov 20, 2025

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind test

/kind feature

/kind sync

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

libbpf_probe_bpf_helper returns 1 if the given combination of program type and helper is supported, 0 or a negative number otherwise. This PR accounts for the negative number case by explicitely checking that the returned value is different from 1.
See https://docs.ebpf.io/ebpf-library/libbpf/userspace/libbpf_probe_bpf_helper/.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

/milestone 0.23.0

Does this PR introduce a user-facing change?:

NONE

`libbpf_probe_bpf_helper` returns 1 if the given combination of
program type and helper is supported, 0 or a negative number
otherwise. Account for the negative number case by explicitely
checking that the returned value is different from 1.
See https://docs.ebpf.io/ebpf-library/libbpf/userspace/libbpf_probe_bpf_helper/.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.90%. Comparing base (bb45c63) to head (94391e0).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2720   +/-   ##
=======================================
  Coverage   76.90%   76.90%           
=======================================
  Files         296      296           
  Lines       30875    30875           
  Branches     4693     4693           
=======================================
  Hits        23745    23745           
  Misses       7130     7130           
Flag Coverage Δ
libsinsp 76.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@irozzo-1A irozzo-1A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@poiana
Copy link
Copy Markdown
Contributor

poiana commented Nov 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops, irozzo-1A

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Nov 20, 2025
@poiana poiana merged commit eca5737 into falcosecurity:master Nov 20, 2025
46 of 47 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Nov 20, 2025
@ekoops ekoops deleted the ekoops/fix-bpf-helper-probe-handling branch November 21, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants