Skip to content

Conversation

@ekoops
Copy link
Contributor

@ekoops ekoops commented Jul 4, 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

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:

The current bpf and kmod's connect fillers implementations extract socket tuple information only if the socket file descriptor is greater than or equal to zero: this does not ensure that the file descriptor is valid and that the kernel has the correct amount of information needed to build the socket tuple.

On the other side, the modern probe implementation correctly checks the system call return value on the exit program, but doesn't try hard enough to build the socket tuple, as it does not leverage the sockaddr provided by the user.

This PR aligns all three implementations, checking the system call return value and leveraging the user-provided sockaddr information to build the socket tuple.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana poiana added the kind/test PRs increasing the test coverage without fixing any failing test label Jul 4, 2025
@poiana
Copy link
Contributor

poiana commented Jul 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops

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

@ekoops
Copy link
Contributor Author

ekoops commented Jul 4, 2025

/milestone 0.22.0

@poiana poiana added this to the 0.22.0 milestone Jul 4, 2025
@poiana poiana added the size/XL label Jul 4, 2025
@github-actions
Copy link

github-actions bot commented Jul 4, 2025

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

@ekoops
Copy link
Contributor Author

ekoops commented Jul 4, 2025

/unhold as schema version check is a false positive.

@codecov
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.53%. Comparing base (b917815) to head (bf66bc2).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2528   +/-   ##
=======================================
  Coverage   78.53%   78.53%           
=======================================
  Files         292      292           
  Lines       31953    31953           
  Branches     4642     4642           
=======================================
  Hits        25094    25094           
  Misses       6859     6859           
Flag Coverage Δ
libsinsp 78.53% <ø> (ø)

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.

The current bpf and kmod's `connect` fillers implementations extract
socket tuple information only if the socket file descriptor is greater
than or equal to zero: this does not ensure that the file descriptor
is valid and that the kernel has the correct amount of information
needed to build the socket tuple.

On the other side, the modern probe implementation correctly checks
the system call return value on the exit program, but doesn't try
hard enough to build the socket tuple, as it does not leverage the
sockaddr provided by the user.

Align all three implementations, checking the system call return value
and leveraging the user-provided sockaddr information to build the
socket tuple.

Signed-off-by: Leonardo Di Giovanna <[email protected]>
@ekoops ekoops force-pushed the ekoops/fix-connect branch from 425b430 to bf66bc2 Compare July 4, 2025 10:57
@github-actions
Copy link

github-actions bot commented Jul 4, 2025

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-4.19 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2-5.10 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡 🟡 🟡
centos-4.18 🟢 🟢 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-4.15 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

@poiana
Copy link
Contributor

poiana commented Jul 4, 2025

LGTM label has been added.

DetailsGit tree hash: 8b571ca1d636664239b6369b5711752feea120ba

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Jul 4, 2025
@jasondellaluce
Copy link
Contributor

/unhold

@poiana poiana merged commit 0752d75 into master Jul 4, 2025
67 of 70 checks passed
@poiana poiana deleted the ekoops/fix-connect branch July 4, 2025 12:11
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Jul 4, 2025
@leogr leogr modified the milestones: 0.22.0, 9.0.0+driver Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants